how to plot create z-matrix from x,y,z cordinates

14 views (last 30 days)
Hi, I'm just new to Matlab. I wish to plot the surface contour plot with the x, y, z coordinate having 1024 values. could anyone help me out with it .....

Answers (2)

Star Strider
Star Strider on 12 May 2016
If your ‘x, y, z coordinate having 1024 values’ are already 2D matrices of the same size, each with 1024 elements, you can generate a surface and contour plot with:
surfc(x, y, z)
  2 Comments
kesavan ekambaram
kesavan ekambaram on 13 May 2016
hi, I tried with surfc(x,y,z); but the error persisted as the surface Z must contain more than one row or column. In my workspace it showed as x= 1024x1, y=1024x1, z=1024x1. Now how could I solve out this error...
Star Strider
Star Strider on 13 May 2016
It depends on how your data are organised. Even though they’re vectors, they could actually be gridded.
I would plot your data as:
stem3(x, y, z)
to see what your data look like. If they appear to be gridded, you may only need to reshape the vectors into matrices to use the surf function.

Sign in to comment.


Walter Roberson
Walter Roberson on 13 May 2016

Community Treasure Hunt

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

Start Hunting!