How can I set the color of a surfplot?

1 次查看(过去 30 天)
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

回答(1 个)

Walter Roberson
Walter Roberson 2014-3-4
surf(I, J, K, Q)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by