plot 3D grid using mesh() with lack of individual data
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Star Strider
2021-10-7
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')
.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!