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 Exchange2-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