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 Center および File ExchangeRed についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by