Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Longitude Latitude Value
- --------- -------- -----
- 12.345678 23.456789 25
- 12.345679 23.456790 26
- %should be :
- % x y z
- surf(matrix(:,1) , matrix(:,2) , matrix(:,3));
- Error using surf (line 75)
- Z must be a matrix, not a scalar or vector
- x = matrix(:,1);
- y = matrix(:,2);
- z = matrix(:,3);
- xi=linspace(min(x),max(x),30)
- yi=linspace(min(y),max(y),30)
- [XI YI]=meshgrid(xi,yi);
- ZI = griddata(x,y,z,XI,YI);
- contourf(XI,YI,ZI)
- xMin=min(myMat(:,1));
- xMax=max(myMat(:,1));
- yMin=min(myMat(:,2));
- yMax=max(myMat(:,2));
- step_x=0.5; %depends on your data
- [xGrid,yGrid]=meshgrid(xMin:step_x:xMax,yMin:step_y:yMax);
- surf(xGrid,yGrid,valMat);
- N=50;
- x = 2*pi*rand(N,1);
- y = 2*pi*rand(N,1);
- z = sin(x).*sin(y);
- matrix = [x y z];
- tri = delaunay(matrix(:,1),matrix(:,2));
- trisurf(tri,matrix(:,1),matrix(:,2),matrix(:,3))
- shading interp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement