MATLAB: Put me out of the misery

plot

i have 3 matrices..
x = 1 * 264;
y = 1* 264;
z = 1 * 264;
contour(x,y,z) % error z must be 2* 2 or more
hence i did
[X,Y] = meshgrid(x,y); Z =griddata(x,y,z,X,Y);
contour(X,Y,Z) is giving some weird plot. Not desirable.
Now how to do it…

Best Answer

First you have to get yourself a good overview of what you actually have, I suggest using scatter:
qwe = xlsread('yourfile.xls');
scatter(qwe(:,1).*cos(qwe(:,2)*pi/180),...
qwe(:,1).*sin(qwe(:,2)*pi/180),15,...
(qwe(:,3)-min(qwe(:,3)))*5+5,'filled')
So there you see some odd spots (sensor faulty or something?). At least easy to reinterpolate outside that region:
X = 24.7:0.1:27;
Y = 0:0.1:5;
[X,Y] = meshgrid(X,Y);
Z = griddata(qwe(:,1).*cos(qwe(:,2)*pi/180),...
qwe(:,1).*sin(qwe(:,2)*pi/180),qwe(:,3),X,Y);
% Or any of the newer variants like Walter suggested.
% do the contour:
hold on
contour(X,Y,Z,1.25:0.025:max(qwe(:,3)),'b')
HTH