/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/sq.m
ViewVC logotype

Annotation of /MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/sq.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1.1.1 - (hide annotations) (download) (vendor branch)
Tue Nov 11 18:08:08 2003 UTC (23 years ago) by cnh
Branch: MAIN, initial
CVS Tags: baseline, HEAD
Changes since 1.1: +0 -0 lines
Checking in work done with Dimitri on high-resolution cube gridding and parallel 
communications. 
   o code is in a contrib experiment for now so we can continue collaborating
     on it. However most code is general and will be moved into main branch once 
     it is fully hardened.
   o There are README files in the contrib root and in the subdirectories that
     explain the contents

1 cnh 1.1 % sq(A) is similar to squeeze(A) except that elements =0 are set to NaN
2     %
3     % sq(A) 0 -> NaN
4     % sq(A,val1) val1 -> NaN
5     % sq(A,val1,val2) val1 -> val2
6    
7     function [A] = sq(B,varargin);
8     A=squeeze(B);
9     if nargin>=2
10     nodata=varargin{1};
11     else
12     nodata=0;
13     end
14     if nargin==3
15     newval=varargin{2};
16     else
17     newval=NaN;
18     end
19     %A(find(A==nodata))=A(find(A==nodata))*NaN;
20     A(find(A==nodata))=newval;

  ViewVC Help
Powered by ViewVC 1.1.22