Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

3d surface plot

Status
Not open for further replies.

GeorgeEllwood

Mechanical
Aug 22, 2006
134
Hello,
I was wondering if someone can help me with this problem. I would like to plot a 3d surface plot of 3 variables. Like in the attached image. Whatever I try I can't seem get it to work. Two of the variables are ok but the third doesn't plot properly. I've got a matrix 3 columns wide and I would like the surface to go through the point described by the coordinates of each row. I seem to remember being able to do this with Matlab years ago when I was at university but now I can't make it work.
Any help would be greatly appreciated.
Thanks
George
 
Replies continue below

Recommended for you

You can use your matrix in its form if its arranged in [x,y,z] presumably. The function surfc.m plots a 3d surface of a specified matrix.
For example if you have a matrix made up of vectors:
X=[1 2 3 4 5 6 7 8 9]; Y=[4 5 6 7 1 2 3 7 8]; Z=[5 5 5 5 5 5 5 5 5];
C=[X;Y;Z];
surfc(C)

This will give you a 3d surface plot of your matrix in Cartesian coordinates.

Good luck,



Fe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor