Good morning everyone, I ran a simulation with SWAN (Simulating WAve Nearshore) and I am trying to plot several variables on a meshgrid.
I have two matrices: a 72x77 matrix that represents the x-coordinates of the points of the grid and a 72x77 matrix that represents the y-coordinates of the points of the grid. ( These two matrices have Na values in some locations because there are some land obstacles in the domain) With these two matrices I would like to plot the meshgrid and then plot any variable above it ( also 72x77 matrix). For example, the first variable that I would like to show is the water depth, since I want to obtain a bathymetry plot.
Thank you a lot for your help in advance.

 채택된 답변

KSSV
KSSV 2022년 5월 28일

1 개 추천

Read about pcolor, surf

추가 답변 (1개)

Nibras
Nibras 2025년 1월 31일
편집: Walter Roberson 2025년 1월 31일

0 개 추천

%% Your example
data = magic(4);
data(1,2) = nan;
x = [1,2,3,4];
lat = repmat(x,4,1);
lon = lat';
surf(lon,lat,data);view(2);

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2022년 5월 28일

편집:

2025년 1월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by