Matlab is a high-level computing language. There are many purpose using this program. In this post, I will describe how to make bathymetry map from xyz data in Matlab. Main idea of the process is only make x data, y data and z data to be a grid because of use surf command, so simple.
OK lets start .....
Before make a Matlab script, you must have xyz data, as an example I use data from ETOPO 1 National Geophysical Data Center (NGDC) NOAA, you can download here. Select your area of interest and choose xyz data as an output format.
Steps in Matlab :
- Load your xyz data.
- x data is longitude, y data is latitude and z data is depth.
- Use unique command for x data and y data.
lon = unique(yourdata(:,1));
lat = unique(yourdata(:,2));
lat = unique(yourdata(:,2));
- Make a grid from lon and lat data
[LAT LON]=meshgrid(lat,lon);
- Make z data as a grid using this command.
for n=1:length(yourdata)
ilon = find(lon==yourdata(n,1));
ilat = find(lat==yourdata(n,2));
depth(ilon,ilat) = yourdata(n,3);
end
ilon = find(lon==yourdata(n,1));
ilat = find(lat==yourdata(n,2));
depth(ilon,ilat) = yourdata(n,3);
end
- Use surf command.
surf(LON,LAT,depth);
shading interp;
shading interp;
- Run your matlab script.
Bathymetry Map of England
Bathymetry Map of Indonesia
How do you make that colorbar?
ReplyDeleteThe ones for England and Indo?
DeleteI will give you the script and colorbar, please send me your e-mail.
DeleteHi! Riza,
DeleteYour plots are very impressive. Would you please send me the script for making these bathymetric plots? My email is una146@gmail.com. Thanks in advance!
Hi! Riza,
DeleteYour plots are very impressive. Would you please send me the script for making these bathymetric plots? My email is una146@gmail.com. Thanks in advance!
use the command "colorbar" or
Delete"help colorbar" for more information
Hi, would you please send me the script for making these bathymetric plots? My email is kmlim1@sheffield.ac.uk ,Thanks in advance!
Deletehow can i do this but vertically?
ReplyDeleteI will give you the script and colorbar, please send me your e-mail?
DeleteHi..can u send me also.. hafifinazir@gmail.com
ReplyDeletemay i get your script sir?
ReplyDeletejherjati@s.itb.ac.id
Hi Riza your plots are perfect could you please send me a copy of your matlab script ? I really need it thank you (e-mail: bouradine@ipgp.fr)
ReplyDeleteWould you share your script with me as well,
ReplyDeletebuktenicm@gmail.com
Would you mind sharing your script with me as well
ReplyDeletearjkohli@gmail.com
Thank you
Thank you!
ReplyDeleteWould you mind sharing your script with me as well?
ReplyDeletekatakhn@gmail.com
Please can you send my your script too?
ReplyDeletemax-campbell@hotmail.co.uk
Thankyou very much
would you mind sharing your sript with me as well ?
ReplyDeletehazimsalma0@gmail.com
Hi riza do you have any code for HF RADAR data?
ReplyDeleteHi Riza,
ReplyDeleteMay I ask you to do me a favor and send me your script.
Respectfully,
Ehsan
sadighehsan@gmail.com
Sir how can we show these bathymetry profile varrying with depth?
ReplyDeleteKindly send me a script at davidddumba@gmail.com Thanks in advance
ReplyDeleteNice figures! Could you send me the matlab scripts to heychq0926@gmail.com? thanks a lot!
ReplyDeleteHi Riza,
ReplyDeleteI got a 3D plot instead of a map. Can you please send me the script on vgbest@gmail.com. Thank you in advance.
Great colors for Britain and Indonesia! Can you send me your script too? abochdan@odu.edu. Thank you, Alexander
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWould you please send me that script to monocilindro1@gmail.com?
ReplyDeletethanks
This comment has been removed by the author.
ReplyDeletePlease could you send me your script for the bathymetry map please ?
ReplyDeleteThank You
(clement.vincentbrest@gmail.com)
Hi Riza,
ReplyDeletecould you send me your script aswell?
Thank you!
fabian.groscurth@gmail.com
Hi Riza, would really appreciate if u sent me your script for bathymetry. Here my email (wadizukri@gmail.com). thank you!
ReplyDeleteHi Riza, I would also like to have your matlab scripts. My email is ronaldsalazar32@gmail.com. Thanks alot!!!!!!!!
ReplyDeleteHi Riza, i need your mathlab script for my final task, hope you can send me your script.
ReplyDeletehere my email : mr.rikohermansyah@gmail.com
Hi Riza.. would you please send me that script to arifiyana29@gmail.com.. thanks Riza..
ReplyDeleteHi,
ReplyDeleteI am also very interested in having your script as I'm currently working on a mountain lake.
hydrogene894@gmail.com
Thanks a lot
Hi, I need show a graph bathymetry but appears me in the promt this Requested 206414x209349 (322.0GB) array exceeds maximum array size preference. I hope you can help me.
ReplyDeleteThanks in advance
Hello
ReplyDeleteI have 3 column in Excel respectly lat, lon, depth. I have a 2d view with depht in color with geoscatter. But yet I would like a bathymetry in 3d with color. Can you help me please or write the code matlab and send me per email:audyb.2@gmail.com thank you
hi riza
ReplyDeletei am raja mohamed and wish if you could share your code to plot the map it would help me in great deal. thank you. rajadelip@gmail.com
Nice Plots and great work.
ReplyDeleteCould you please also send me the matlab code to plot the bathymetry data?
Thanks Lee poteterqing@hotmail.com
please share your matlab batimetric code and color bar and relief
ReplyDeletein order to use and replicate
please share your matlab batrimetric code and color bar and relief
ReplyDeletein order to use and replicate
sincerely Carlos, e-mail: Ccarmona@ciencias.unam.mx