plot 3D surface for this function: X=F(phi,beta,rho) Y=F(phi,beta,rho) Z=F(phi,beta,rho)

1 view (last 30 days)
Could you tell me how I can plot 3D surface for this function:
phi1=-pi/2:0.01*pi:pi/2;
phi2=-pi/2:0.01*pi:pi/2;
phi3=-pi/2:0.01*pi:pi/2;
X=0.4*cos(phi1)*sin(phi3)+0.4*sin(phi1)*cos(phi3)+0.35*sin(phi1);
Y=sin(phi3)+0.4*sin(phi1);
Z=0.2*cos(phi1)*sin(phi3)-0.4*cos(phi1)*cos(phi3)+0.35*cos(phi1);
so, how can i plot X Y Z in 3d axis

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 3 Jul 2015
Edited: Azzi Abdelmalek on 3 Jul 2015
phi1=-pi/2:0.01*pi:pi/2;
phi2=-pi/2:0.01*pi:pi/2;
phi3=-pi/2:0.01*pi:pi/2;
X=0.4*cos(phi1).*sin(phi3)+0.4*sin(phi1).*cos(phi3)+0.35*sin(phi1);
Y=sin(phi3)+0.4*sin(phi1);
Z=0.2*cos(phi1).*sin(phi3)-0.4*cos(phi1).*cos(phi3)+0.35*cos(phi1);
plot3(X,Y,Z)
  1 Comment
Tuyen
Tuyen on 3 Jul 2015
Edited: Azzi Abdelmalek on 3 Jul 2015
Thank you very much. However, I need
phi1 running from -pi/2 to pi/2 while phi2=const, phi3=const.
Consequentially, phi2 running while phi1=const, phi3=const...
And phi3 running while phi1=const, phi2=const It look like this example
syms s t
r = 2 + sin(7*s + 5*t);
x = r*cos(s)*sin(t);
y = r*sin(s)*sin(t);
z = r*cos(t);
ezsurf(x, y, z, [0, 2*pi, 0, pi])
However, it just support for 2 variables (s, t) only.
I need the function for 3 variables as my problem

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!