I have an array of values for theta and phi. How can I easily create a MATLAB plot where theta and phi are spherical coordina
theta
phi
Can you try this:
[X, Y, Z] = sph2cart(theta, phi, P); plot3(X, Y, Z)
Then use [Rotate 3D] button to rotate it to better looking.
try this: [X, Y, Z] = sph2cart(theta, phi, R); Which R is the radius of your sphere and here is R = sqrt(sum(P.^2)); Then plot it like: scatter3(X,Y,Z);
[X, Y, Z] = sph2cart(theta, phi, R);
R = sqrt(sum(P.^2));
scatter3(X,Y,Z);