How can I set the color of a surfplot?

1 view (last 30 days)
Martin
Martin on 4 Mar 2014
Answered: Walter Roberson on 4 Mar 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

Answers (1)

Walter Roberson
Walter Roberson on 4 Mar 2014
surf(I, J, K, Q)

Tags

Community Treasure Hunt

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

Start Hunting!