Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Plotting Three Column Vectors As A Surface

Status
Not open for further replies.

Stringmaker

Mechanical
Mar 18, 2005
513
I'm a relatiely new Matlab user and I'm trying to plot a surface within Matlab and am not having much luck. I always get error or warning message that the matrix dimensions must agree. What I have is three column vectors, X, Y, and Z which all contain 21 entries. Each row in the three vectors corresponds to a nodal position This is a plate problem where X and Y define the physical dimensions and Z is the displacement. Is it possible to plot the XYZ position for each node given that everything is in vector form? I've tried using the surf and surfc commands however it seems they only work with square matrices. Any help would be very much appreciated!

Thanks in advance,
-Brian
 
Replies continue below

Recommended for you


The surf function only likes to plot on rectangular grids. You have two options:

1. Use the griddata function to interpolate your vectors:
[XI,YI,ZI] = griddata(x,y,z,XI,YI)

2. Hand-process your grid into a set of patches and plot each one separately using the 'patch' function.

CV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor