36 views (last 30 days)

Walter Roberson
on 27 Oct 2018

[i, j] = ndgrid(1:N_theta, 1:N_phi);

theta = i .* pi ./ (N_theta + 1);

phi = 2 .* pi .* (j-1) ./ N_phi;

r = 1;

coords = [theta(:), phi(:)];

coords(:,3) = r;

Walter Roberson
on 29 Oct 2018

[i, j] = ndgrid(1:N_theta, 1:N_phi);

theta = i .* pi ./ (N_theta + 1);

phi = 2 .* pi .* (j-1) ./ N_phi;

r = 1;

b = [theta(:).'; phi(:).'; r * ones(1,numel(theta))];

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/426363-how-to-index-points-and-store-them-all-in-an-array#comment_628741

⋮## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/426363-how-to-index-points-and-store-them-all-in-an-array#comment_628741

## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/426363-how-to-index-points-and-store-them-all-in-an-array#comment_628982

⋮## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/426363-how-to-index-points-and-store-them-all-in-an-array#comment_628982

Sign in to comment.