Split Matrix and Use Mesh to Plot in Matlab

108 Views Asked by At

I'm a newbie in Matlab and this community. Recently I'd like to use a 3*3 matrix with x,y,z in each row to plot a 3D graph:

Array=reshape(1:9,3,3)
M=reshape(Array,[],3)
A=M(:,1)
B=M(:,2)
C=M(:,3)
mesh(A,B,C)

Now the dialogue keep showing "Z must be a matrix, not a scalar or vector" for mesh command. Is there any wrong about A,B,C matrix?

0

There are 0 best solutions below