I just created a 3D surface in MATLAB
using the code below :
p = patch ( 'Vertices' , XYZ , 'Faces' , F ) ;
set ( gca , 'CLim' , [-2000 1500] ) ;
set ( p , 'FaceColor' , 'interp' , 'FaceVertexCData' , V , 'EdgeColor' , 'none' , ...
... 'CDataMapping' , 'scaled' ) ;
axis 'equal';
axis 'tight';
set(gca, 'YDir','normal');
where XYZ
is a 352x3
matrix containing coordinates of the points of the 3D surface.
F
is a 700x3
matrix containing the faces which connect the points.
V
is a 352x1
matrix containing the values on each of the 352 points of the 3D surface.
Now this is the question : How can I plot 3D contours on the surface !!?
I've already tried contour3
function, but it requires the input matrices to be of the different dimensions than now. ( I may need to use meshgrid, but unfortunately my XYZ points are irregularly distributed. However I'm not sure whether I can do this, since I'm using the patch function. )
Please help me on this.