Finding a matrix representing points of sphere
Show older comments
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)
Alan Stevens
on 28 Aug 2020
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),'.')
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!