plot 3D grid using mesh() with lack of individual data
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I want to use mesh to plot 3D grids with the format of mesh(x, y, z). My z is a 47*11 matrix, in which the 7 column actually has only 45 values, and I set the other 2 numbers as NaN in order to from a matrix with other columns. But when I plot the figure, the location of NaN is blank (see below).
Is there any method to fill these special locations? Thanks!
0 Commenti
Risposta accettata
Star Strider
il 7 Ott 2021
It would be best to have your data, however an illustration of the procedure using the fillmissing function is — .
x = 1:11;
y = 1:47;
z = y(:)*x
figure
mesh(x, y, z)
grid on
title('Original')
z(20:25,5:7) = NaN; % Create Gaps
figure
mesh(x, y, z)
grid on
title('With Gaps')
z = fillmissing(z, 'linear');
figure
mesh(x, y, z)
grid on
title('Interpolated')
.
2 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!