Extracting data from matrix

2 ビュー (過去 30 日間)
Ahmet Hakan UYANIK
Ahmet Hakan UYANIK 2021 年 5 月 2 日
回答済み: Chad Greene 2021 年 5 月 2 日
I have a matrix A with the size of 127x6750 which is longitude and latitude when plotted covering the world. Also matrix B with the same size but consist of zeros and ones; zeros corresponds to ocean, ones corresponds to land.
So when i plot this, I just want to plot data corresponds to ocean. How can i combine both and plot only one feature?


Chad Greene
Chad Greene 2021 年 5 月 2 日
To only plot the ocean data, try masking out the land data by setting those values in A to NaN. like this:
A(B==1) = NaN; % sets land grid cells to NaN
shading flat

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by