Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Code for masking out wet points in bathymetry data

Subject: Code for masking out wet points in bathymetry data

From: Alice

Date: 9 May, 2013 14:34:14

Message: 1 of 2

Hello,

I am currently trying to create a bathymetric input grid for an oceanographic model. Does anybody know of any code for masking out wet areas? In order to make my grid I have used the following:

%%%%%%%%%%%%%%%%%%
%Sort out Dep Data,
Dep(Dep>=0)=-999; %Mask land data
%%%%%%%%%%%%%%%%%%
%Make plotable
cellsize =1/60; % grid resolution
[X,Y] = meshgrid(xlin,ylin);
GRID = griddata(Lon,Lat,Dep,X,Y);
%%%%%%%%%%%%%%%%%%

Any help with this would be much appreciated

Alice

Subject: Code for masking out wet points in bathymetry data

From: TideMan

Date: 9 May, 2013 19:52:54

Message: 2 of 2

On Friday, May 10, 2013 2:34:14 AM UTC+12, Alice wrote:
> Hello,
>
>
>
> I am currently trying to create a bathymetric input grid for an oceanographic model. Does anybody know of any code for masking out wet areas? In order to make my grid I have used the following:
>
>
>
> %%%%%%%%%%%%%%%%%%
>
> %Sort out Dep Data,
>
> Dep(Dep>=0)=-999; %Mask land data
>
> %%%%%%%%%%%%%%%%%%
>
> %Make plotable
>
> cellsize =1/60; % grid resolution
>
> [X,Y] = meshgrid(xlin,ylin);
>
> GRID = griddata(Lon,Lat,Dep,X,Y);
>
> %%%%%%%%%%%%%%%%%%
>
>
>
> Any help with this would be much appreciated
>
>
>
> Alice

Try this:
 Dep(Dep>=0)=NaN;
instead of
 Dep(Dep>=0)=-999;

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us