a question a bout plot in matlab

144 Views Asked by At

I am trying to plot 3-D figure in matlab. I know how to use plot3 and surface. But now I have a vector and no a matrix. Actually I have $(x,y)$ and $u(x,y)$ that $u(x,y)$ is obtained after solving my problem. when I using plot with mesh, my figure is not true. please help me.

1

There are 1 best solutions below

5
On

Let's say that you put a grid in two vectors x and y, then you could do the following.

[X,Y]=meshgrid(x,y);
surf(X,Y,Z);