Borrar filtros
Borrar filtros

How can I set the color of a surfplot?

1 visualización (últimos 30 días)
Martin
Martin el 4 de Mzo. de 2014
Respondida: Walter Roberson el 4 de Mzo. de 2014
Hello,
i have created a 3d-mesh with following code
if true
RTHETA=-pi/2:0.03:pi/2;%Polar
RPHI=0:0.03:2*pi; %Azimut
[THETA PHI]=meshgrid(RTHETA,RPHI);
ZP=abs(sinc(15*sin(THETA).*cos(PHI)/pi).*sinc(5*sin(THETA).*sin(PHI)/pi));
end
Now I want to plot this function in sphere coordinates. So I did a transform:
if true
I=ZP.*sin(THETA).*cos(PHI);
J=ZP.*sin(THETA).*sin(PHI);
K=ZP.*cos(THETA);
end
Now I want to plot this
if true
surf(I,J,K)
end
It works, but the color map is not so perfect. Because you cant almost see no details. Now I want to set the color of a point corresponding to its curvature. I found the function:
if true
Q=surfature(I,J,K);
end
And there was no error, but now I dont know how to combine it with my plot. Can you help me with this? Thank you!
Kind Regards Martin

Respuestas (1)

Walter Roberson
Walter Roberson el 4 de Mzo. de 2014
surf(I, J, K, Q)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by