Please help me, i would to make the color of this run figure as the color of the attached figure

조회 수: 17 (최근 30일)
T K
T K 2025년 10월 18일 22:38
답변: DGM 2025년 10월 18일 23:55
x=-20:0.1:20; t=-10:0.1:10;
[X,T]=meshgrid(x,t);omega=0.11;b=0.01;sig=sqrt(omega-10*b);
alfa=0.1 ;a=0.1;c=-(alfa+2*a*k);k=alfa/a;
v1=(2*b)/(omega-sig^2+k*(a*k-alfa));
f=(exp(1./((-v1*(1)*((-1)-(3/5))*(coth(v1.*(2)*(X-c*T))).^2))));
disp(v1)
disp(c)
surf(X,T,f,'EdgeColor','none');
colorbar
xlabel('x'); ylabel('t'); zlabel('u(x,t)')

답변 (1개)

DGM
DGM 2025년 10월 18일 23:55
The picture is a tiny JPG, so I can't do anything other than guess what the colormap is. I can tell it's a circular map, roughly similar to hsv(). It looks a little smoother, but that's probably just an artifact of the low quality.
k = 1; % ??? don't know what this is supposed to be
x = -20:0.1:20;
t = -10:0.1:10;
[X,T] = meshgrid(x,t);
omega = 0.11;
b = 0.01;
sig = sqrt(omega-10*b);
alfa = 0.1;
a = 0.1;
c = -(alfa+2*a*k);
k = alfa/a;
v1 = (2*b)/(omega-sig^2+k*(a*k-alfa));
f = (exp(1./((-v1*(1)*((-1)-(3/5))*(coth(v1.*(2)*(X-c*T))).^2))));
surf(X,T,f,'EdgeColor','none');
colorbar
xlabel('x'); ylabel('t'); zlabel('u(x,t)')
colormap(hsv(256))
If you expect the central cyan to be located at a certain z-level (e.g. zero), then you need to configure clim() such that it's centered around that value.
As to whether there's a rainbow map that more closely matches the example, I can't really tell.

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by