Finding a matrix representing points of sphere

I want try to use active contour algorithm in 3D.
For that I need initial boundary. I want to select initial boundary as sphere or ellipsoid.I can not use sphere function since it is in graphic format.
I need a matrix [Ax3] representing points on sphere. Where A is no of points

Answers (1)

Why can't you use sphere? You can get your matrix as follows:
N = 19; A = (N+1)^2; R = 2; % Example data with R as sphere radius
[X,Y,Z] = sphere(N);
S = R*[X(:), Y(:), Z(:)]; % This is your Ax3 matrix
To see the result:
plot3(S(:,1),S(:,2),S(:,3),'.')

Asked:

on 28 Aug 2020

Answered:

on 28 Aug 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!