mesh() and surf() errors & sorting [x, y, z] matrix into meshgrid matrix
From:
Michael Barton
Subject:
mesh() and surf() errors & sorting [x, y, z] matrix into meshgrid matrix.
Date:
Mon, 7 Jul 2008 11:10:50 -0700
I have a large collection of data points in the form of (x,y,z) coordinates stored in an [N,3] matrix. Octave can successfully run: plot3() with any warnings or errors. However, I need to use contour() and surface plots like surf() and mesh(). Unfortunately, Octave crashes with a memory error with the command: contour().
As for surf() and mesh(), the following error messages are returned: surf(DataSet(:,1),DataSet(:,2),DataSet(:,3)): error: rows(z) must be the same as length(y) and columns (z) must be the same as length(x) ...
mesh(DataSet(:,1),DataSet(:,2),DataSet(:,3)):
error: rows(z) must be the same as length(y) and columns (z) must be the same as length(x)
...
From the documentation, surf() and mesh() require the a grid of x and y data to be established. Is there anyway to sort the DataSet matrix in such a way that surf() and mesh() plot successfully?