How do I plot a sphere using the cylinder function?
Mostrar comentarios más antiguos
I know that I can easily plot a sphere using the sphere function, but I am trying to do it with the cylinder function. This is what I have so far, but I can't seem to get the function right.
clc;
x1 = linspace(0,pi,100);
y1 = linspace(0,1,100);
z1 = linspace(0,2,100);
[x2, y2,z2]=cylinder(x.^2+y.^2),200);
figure(2);
surf(x2, y2,z2);
xlabel('X');
ylabel('Y');
zlabel('Z');
colormap(jet)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!