Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Masking tool/ blanking cell for bathymetry
Replies: 4   Last Post: May 9, 2013 10:28 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Rune Allnor

Posts: 4,455
Registered: 12/7/04
Re: Masking tool/ blanking cell for bathymetry
Posted: May 3, 2009 12:10 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 3 Mai, 13:04, "Yvonne " <h...@waikato.ac.nz> wrote:
> Hi,
>
> I am trying to write a code to mask all the land value for my bathymetry grid. The land points were manually digitised. Is there any suggestions on how to create a mask or a blanking cell for the land boundaries and the area that I do not want in my grid?


Try to set all the z-values of the land data points to NaN:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
xv=randn(10000,1);
yv=randn(10000,1);
zv= exp(-(xv.^2+yv.^2))-0.9;

t=delaunay(xv,yv);
trimesh(t,xv,yv,zv) % Plots all data points
figure

Zv=zv;
Zv(Zv>0)=nan;
trimesh(t,xv,yv,Zv) % Leaves out points with z-values > 0.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Rune



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.