How to draw a sphere in Matlab ?
In Matlab, there is no function to draw a sphere. Therefore, the sphere
keyword returns the—ready-to-draw—coordinates of a sphere. The coordinates can be plotted with the surf
function:[X,Y,Z] = sphere;
surf(X,Y,Z);
axis square equal;
To specify the center and the radius of the sphere, use the following code :[X,Y,Z] = sphere;
radius = 3;
center = [4,3,2]
X = center(1) + X*radius
Y = center(2) + Y*radius
Z = center(3) + Z*radius
surf(X,Y,Z);
axis square equal;
In Matlab, there is no function to draw a sphere. Therefore, the sphere
keyword returns the—ready-to-draw—coordinates of a sphere. The coordinates can be plotted with the surf
function:[X,Y,Z] = sphere;
surf(X,Y,Z);
axis square equal;
To specify the center and the radius of the sphere, use the following code :[X,Y,Z] = sphere;
radius = 3;
center = [4,3,2]
X = center(1) + X*radius
Y = center(2) + Y*radius
Z = center(3) + Z*radius
surf(X,Y,Z);
axis square equal;
In Matlab, there is no function to draw a sphere. Therefore, the sphere
keyword returns the - ready-to-draw - coordinates of a sphere. The coordinates can plos plotted with the surf
function:[X,Y,Z] = sphere;
surf(X,Y,Z);
axis square equal;
To specify the center and the radius of the sphere, use the following code :[X,Y,Z] = sphere;
radius = 3;
center = [4,3,2]
X = center(1) + X*radius
Y = center(2) + Y*radius
Z = center(3) + Z*radius
surf(X,Y,Z);
axis square equal;