MATLAB: How to plot a 3D surface from N by 3 matrix

3d plots

I have a matrix with dimensions N by 3, for example 100 rows and 3 columns. Each row correspondds to the 3D location of a point, i.e., we have 100 points. I want to pot the 100 points and connect them as a surface.

Best Answer

Try,
S = size(matrix); %"matrix being your generic matrix
[X, Y] = meshgrid(1:S(2), 1:S(1));
Z = matrix; %e.g. 100 by 3 matrix
surf(X,Y,Z)
Related Question