Creating 2D contours from XYZ values
Show older comments
I need to create a 2D contour map from the following X,Y,Z values:
x =
62158.9992780663
-60909.305073411
-66390.9511725443
39368.6900415121
51352.5822375015
-21369.5783460914
-87076.7531674554
49625.0647256742
38699.5563685481
52310.578005926
-66729.7609269372
y =
-464698.41308258
316839.903892009
298087.560112334
-499661.758015527
298806.606131584
129251.742701853
256843.382855648
-367726.4174525
-566816.147075169
320336.240040152
278737.299892196
z =
266.712
37.838
7.79
301.42
145.949
145.305
112.418
289.788
268.437
-10.679
201.505
The X and Y values are grid coordinates. The Z values are ellipsoidal heights in metres.
I tried using the following code:
contour(x,y,z)
And I get this error:
Error using contour (line 48)
Z must be at least a 2x2 matrix.
Error in Contours (line 284)
contour(x,y,z)
Can anyone help me create a contour map with contour lines every 10m?
Accepted Answer
More Answers (1)
KSSV
on 18 May 2020
0 votes
Read about delaunayTriangulation. And then use this https://in.mathworks.com/matlabcentral/fileexchange/38858-contour-plot-for-scattered-data?focused=5249779&tab=function
1 Comment
Wesley Brown
on 19 May 2020
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
