フィルターのクリア

I want to improve the mesh of my graph ?

2 ビュー (過去 30 日間)
merwan behar
merwan behar 2023 年 3 月 26 日
コメント済み: Mathieu NOE 2023 年 3 月 28 日
I want to increase the mesh of my graph so that it is clear and explanatory and I cannot use the interp2 function.
my code:
clear
clc
x=-(0:0.05:0.2);
y=0:0.5:2;
Z=[20.5896 20.7032 21.0404 21.5908 22.3385;21.1888 21.2992 21.6272 22.1630 22.8920;.......
21.7715 21.8790 22.1984 22.7208 23.4325;22.3391 22.4439 22.7553 23.2652 23.9607;....
22.8926 22.9948 23.2989 23.7971 24.4775];
[X,Y] = meshgrid(y,x);
surf(X,Y,Z)
title ('(d)')
xlabel('l (nm)');
ylabel('V0 (volt)');
zlabel('{\omega} (GHz)');

採用された回答

Mathieu NOE
Mathieu NOE 2023 年 3 月 27 日
hello
sure you can use interp2
see example below
I opted for spline method for a smoother surface rendering
clear
clc
x=-(0:0.05:0.2);
y=0:0.5:2;
Z=[20.5896 20.7032 21.0404 21.5908 22.3385;21.1888 21.2992 21.6272 22.1630 22.8920;.......
21.7715 21.8790 22.1984 22.7208 23.4325;22.3391 22.4439 22.7553 23.2652 23.9607;....
22.8926 22.9948 23.2989 23.7971 24.4775];
[X,Y] = meshgrid(y,x);
figure(1),
subplot(2,1,1),surf(X,Y,Z)
title ('(d)')
xlabel('l (nm)');
ylabel('V0 (volt)');
zlabel('{\omega} (GHz)')
% refined mesh plot
N = 10; % upsampling factor
dx = mean(diff(x));
xi=x(1):dx/N:x(end);
dy = mean(diff(y));
xi=x(1):dx/N:x(end);
yi=y(1):dy/N:y(end);
[Xi,Yi] = meshgrid(yi,xi);
Zi = interp2(X,Y,Z,Xi,Yi,'spline');
subplot(2,1,2),
surf(Xi,Yi,Zi)
title ('(d)')
xlabel('l (nm)');
ylabel('V0 (volt)');
zlabel('{\omega} (GHz)');
  2 件のコメント
merwan behar
merwan behar 2023 年 3 月 27 日
Thank you very much, you are very professional
Mathieu NOE
Mathieu NOE 2023 年 3 月 28 日
my pleasure !
do you mind accepting my answer ? thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by