I would like to draw a mesh plot. As the function goes, it always plots all the entries inside the input matrix. However, now I want a certain entry not to draw out, for example:
x = 1:3
y = 1:3
[X,Y]=meshgrid(x,y);
Z = [2,2,2;4,4,4;5,5,0];
where "0" is the entry I would not like to draw.
After using mesh(X,Y,Z) or surf(X,Y,Z), it still shows that point with height = 0
Is there any way to hide that point? Thanks!
Replace the 0
with inf
:
x = 1:3
y = 1:3
[X,Y]=meshgrid(x,y);
Z = [2,2,2;4,4,4;5,5,inf];
inf
is typically ignored by drawing commands.