[x,y] = meshgrid(-2:.2:2); z = x .* exp(-x.^2 – y.^2); surf(x,y,z)
and I am trying to get the following:
How do I graph it to exclude the mid section like that?
Best Answer
NaN is your friend here:
NOTE — You have to usetwo separate vectors in yourmeshgrid call to create this effect, not the single vector you have in the code you posted. One vector is the one in your code. You have to create the second one with the gap.
Best Answer