MATLAB: I have 3 columns of numerical data and I want to plot a surface. How to do this? I am willing to send the file and code. If I could get a coded response, I would be elated! Thanks.

3d surfacesplotting

Here is the data. I am also attaching my code and the Figure (which is not a surface)!

Best Answer

clc; clear all ;
[num,txt,raw] = xlsread('ScaleData.xlsx');
x = num(:,1) ;
y = num(:,2) ;
z = num(:,3) ;
X = reshape(x,[],3) ;
Y = reshape(y,[],3) ;
Z = reshape(z,[],3) ;
surf(X,Y,Z) ;
shading interp ;