## Bathymetric data into a surface plot

### Ruari Skinner (view profile)

on 16 Feb 2019
Latest activity Commented on by Star Strider

on 16 Feb 2019

### Star Strider (view profile)

Hi,
I have attached a folder which is my given bathymetric data for a seabed. I want to make this into a surface plot or a contour map. I am new to matlab and have little experience with the software, but understand that it is a good software for this particular problem.
If anyone could assit me with this, that would be great.
Thankyou,
Ruari Skinner

### Star Strider (view profile)

on 16 Feb 2019

Try this:
Lon = D(:,1);
Lat = D(:,2);
Dep = D(:,3);
figure
plot3(Lon, Lat, Dep, '.')
grid on
view(35,25)
title('Exploratory Plot')
xLon = linspace(min(Lon), max(Lon), 1E+3);
yLat = linspace(min(Lat), max(Lat), 1E+3);
[X,Y] = meshgrid(xLon, yLat);
zDep = griddata(Lon, Lat, Dep, X, Y);
figure
mesh(X, Y, zDep)
grid on
view(35,25)
title('Mesh Plot')
figure
mesh(X, Y, zDep)
hold on
contour3(X, Y, zDep, 20, 'k', 'LineWidth',2)
hold off
grid on
view(35,25)
title('Mesh Plot With Contours')
This uses the griddata function to create the surface necessary to do the mesh plot. The contour3 plot draws contours. You can specify the contours you want (if you want any at all). I plotted them simply out of my own curiosity.
Experiment to get the result you want.

Star Strider

### Star Strider (view profile)

on 16 Feb 2019
My code runs without error with the data you provided as ‘Bathymetric data (XYZ).xlsx’. Use it and the xlsread call I used.
I have no idea what the problem could be with your code, or your implementation of my code, since you didn’t post it.
Ruari Skinner

### Ruari Skinner (view profile)

on 16 Feb 2019
Sorry I had simple spelling error.
Thank you for your support and quick responce, much appreciated.
Ruari
Star Strider

on 16 Feb 2019
My pleasure.