Plotting Three Column Vectors As A Surface
Plotting Three Column Vectors As A Surface
(OP)
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
Thanks in advance,
-Brian





RE: Plotting Three Column Vectors As A Surface
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