MATLAB: How to connect up points in 3D plot (Or how do surf without a function)

3d plotssurf

I've got a set of data I had intended to use to form a surface plot, however couldn't find how to do it without having the Z variable be a function. So instead I've had to use Plot3, which seems to show the data well enough, however would like to also connect the points along the y axis.
Alternatively a way to use surf with the data I have would be fantastic.
data = xlsread('MatlabAxial.xlsx','Sheet1','A110:AF159');
x=data(2:50,1);
y=data(1,2:32);
t=data(2:50,2:32);
[X, Y] = meshgrid(x,y);
plot3(X,Y,t,'k.:');
grid on
hold on

Best Answer

data = xlsread('Sample.xls');
x=data(2:50,1);
y=data(1,2:32);
t=data(2:50,2:32);
[X, Y] = meshgrid(x,y);
surf(X,Y,t');
grid on
hold on
Related Question