# I want to improve the mesh of my graph ?

4 visualizaciones (últimos 30 días)
merwan behar el 26 de Mzo. de 2023
Comentada: Mathieu NOE el 28 de Mzo. de 2023
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)');
##### 0 comentariosMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos

Iniciar sesión para comentar.

Mathieu NOE el 27 de Mzo. de 2023
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 comentariosMostrar 1 comentario más antiguoOcultar 1 comentario más antiguo
Mathieu NOE el 28 de Mzo. de 2023
my pleasure !
do you mind accepting my answer ? thanks

Iniciar sesión para comentar.

### Categorías

Más información sobre Interpolation en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by