How to create my own landmask?

조회 수: 2 (최근 30일)
anne d.
anne d. 2017년 9월 25일
답변: anne d. 2017년 9월 26일
Hi, I would like to create my own landmask for my model. Until now, my script looks like this:
index_land=isnan(land); %if 1 then land
[x, y] = meshgrid(lon, lat);
land=x.*index_land'; %if 0 then ocean
land(land==0)=nan;%if 0 (=ocean) then nan
h=pcolor(x, y, land);%plot landmask
But my questions now consists in: How can I change my script to be able to use it like a function? I would like to use this pcolor-landmask-plot in several plots. Thank you for your suggestions!
  댓글 수: 2
Image Analyst
Image Analyst 2017년 9월 25일
What is land to begin with? Some kind of data with nans in it? What do you want land to be after you turn it into a mask? A logical image with true and false where there is or isn't land (which is the most typical and sensible way to have a mask)?
anne d.
anne d. 2017년 9월 25일
In the beginning, land is a matrix where the land is described by nans and the ocean has data values. To plot my ocean data a bit more clearly I would like to create and plot a grey coloured land mask.

댓글을 달려면 로그인하십시오.

답변 (1개)

anne d.
anne d. 2017년 9월 26일
No suggestions/ideas?

카테고리

Help CenterFile Exchange에서 Oceanography and Hydrology에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by