Contour map to show ocean depth

25 views (last 30 days)
Jake
Jake on 23 Apr 2020
Commented: Ke Wei Ong on 15 Aug 2020
Hello,
How can I construct a contour map as follows that shows the Ocean depths at a particular location, using Longitude, Latitude and Depth data. (Attached sample xlsx file)
I've been struggling to get something at least slightly similar and I have posted a few posts before this. I'm still learning MATLAB and this has been a dead end for me for some time now. So, literally ANY suggestion, recommendation or help is appreciated.
Now, Do I need more data? Or do I have to have a specific toolbox?
To clarify, I don't mind having different colors or a color bar than the one I have posted. My concern is getting the contour map generated as shown on the post.
Basically, the data refers to Lat, Lon and Depth/Altitude. I am interested in generatnig a contour map that shows different depths/altitudes based on that data set.
I'll add all my previous posts and reference here, to know what my intensions are.
Thank you in advance!

Accepted Answer

darova
darova on 23 Apr 2020
Use griddata
% lat, long, depth - your data
[LAT,LON] = meshgrid(lat,long); % create 2D matrices
DP = griddata(lat,long,depth,LAT,LON); % calculate value at each grid point
contourf(LAT,LON,DP)
  6 Comments
Jake
Jake on 23 Apr 2020
This is exactly what I meant! I honestly didn't expect a code from you because I already took a lot of your time :)
Thanks a bunch. This saved the day!
Ke Wei Ong
Ke Wei Ong on 15 Aug 2020
May I know what is the unit in the legend, is it in meter or milimeter?

Sign in to comment.

More Answers (0)

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!