Ältere Kommentare anzeigen
Hi
I have 3 Arrays with values of which i am doing a 3D plot. Currently i am using "plot3()". I would rather like to have a shaded surface...
x(i)=[cos(psi)*cos(phi)*r];
y(i)=[cos(psi)*sin(phi)*r];
z(i)=[sin(psi)*r];
plot3(x,y,z)
Any Hints?
Akzeptierte Antwort
Weitere Antworten (2)
Grzegorz Knor
am 16 Nov. 2011
[psi phi] = meshgrid(0:0.05:2*pi);
r = 1;
x=cos(psi).*cos(phi).*r;
y=cos(psi).*sin(phi).*r;
z=sin(psi).*r;
surf(x,y,z)
shading interp
By the way, to draw sphere you could use sphere function:
sphere
axis equal
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!