How to change resolution to every other point?

5 ビュー (過去 30 日間)
Nicholas Deosaran
Nicholas Deosaran 2021 年 9 月 3 日
コメント済み: Nicholas Deosaran 2021 年 9 月 3 日
Hello good day,
I would like to know how to change the resoulation of my grid to every other grid point.
I have been looking into how to change it but haven't been anywere.
% load the file named XBeach_masonboro_grid.mat
load XBeach_masonboro_grid.mat
figure()
% plot the topobathymetric surface (z) as a function of space (xgrid, ygrid)
pcolor(xgrid,ygrid,z)
title ('Masonboro Island Grid')
grid on
shading flat
I am able to get the plot to show, but do not know how to change the resoulation to every other grid point.
Thank you!

採用された回答

the cyclist
the cyclist 2021 年 9 月 3 日
編集済み: the cyclist 2021 年 9 月 3 日
res = 2;
pcolor(xgrid(1:res:end,1:res:end),ygrid(1:res:end,1:res:end),z(1:res:end,1:res:end))
will only plot every other point, in both the x and y dimension (and you could make res an even large value if you want).
Is that what you mean?
  1 件のコメント
Nicholas Deosaran
Nicholas Deosaran 2021 年 9 月 3 日
Yes it was thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by