필터 지우기
필터 지우기

How can I set the color of a surfplot?

조회 수: 1 (최근 30일)
Martin
Martin 2014년 3월 4일
답변: Walter Roberson 2014년 3월 4일
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