I need to plot a surface plot from given X and Y coordinate matrixes and z as a constant value.

2 views (last 30 days)
My matrices are X= [0 1;2 3]; and Y = [0,1; 2 3]; Now I need to plot each value of X with every value of y with a z value of 0 i.e. x=0, y=0,z=0 ; x=0,y=1,z=0; x=0,y=2,z=0; x=1,y=0,z=0;and so on. How do I do this?

Accepted Answer

Guillaume
Guillaume on 28 Jun 2018
Why do your X and Y have two columns if it means nothing?
X = 0:3;
Y = 0:3;
Z = 0;
[XX, YY] = ndgrid(X, Y);
surf(XX, YY, repmat(Z, size(XX)));
  3 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!