How to surf semi-random X, Y, Z data

1 view (last 30 days)
Matthew Houston
Matthew Houston on 21 Apr 2015
Answered: Matthew Houston on 21 Apr 2015
So the the question is pretty straight forward. I have X, Y, and Z data that I want to mesh. My code is as follows:
if true
XYZ = xlsread('test.xlsm','Sheet1')
X=XYZ(:,2);
Y=XYZ(:,1);
Z=XYZ(:,3);
[Xi,Yi] = meshgrid(92:0.01:94, -29:0.01:-34);
Zi = griddata(X,Y,Z,Xi,Yi);
surf(Xi,Yi,Zi);
end
The data ranges are as follows: X: ~90 to 96, Y: ~28 to -34, and Z: 0 to 1. (See the attached image of a scatter plot of the data). When I run the above code, however, it returns a blank plot with nothing in it. I can't see what I am doing wrong. Any help is appreciated.

Answers (1)

Matthew Houston
Matthew Houston on 21 Apr 2015
Sorry, See the image above^

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!