How to make a Contour Map
3 views (last 30 days)
Show older comments
Hello,
I am still quite new to MATLAB, and I need to produce a contour map from a data set of x,y,z which represent longitude, latitude, and elevation of a surface.
I have not been able to use the contour function to get an image which makes sense. MATLAB tells me that my Z matrix must be 2x2 at least, which in the case of my data makes no sense.
The data is as follows:
X=[-0.343,-0.338,-0.333,-0.331,-0.3275,-0.3215,-0.315,-0.305,-0.293,-0.327,-0.3225,-0.3175,-0.315]';
Y=[0.461,0.463,0.463,0.4665,0.4675,0.4725,0.4725,0.4775,0.4815,0.4825,0.48,0.4775,0.4725]';
Z=[630,535,520,610,630,610,710,620,690,630,610,610,710]';
Any help with making a contour map would be greatly appreciated.
0 Comments
Answers (1)
John D'Errico
on 14 Nov 2016
You have scattered data. Contour requires GRIDDED data.
Download tricontour from the file exchange. I recall there are two versions up there. Either will be fine.
0 Comments
See Also
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!