[Dart-dev] [4763] DART/trunk/diagnostics/matlab/link_obs.m: removing use of deprecated findstr() in favor of supported strfind()

nancy at ucar.edu nancy at ucar.edu
Thu Feb 24 15:22:52 MST 2011


Revision: 4763
Author:   thoar
Date:     2011-02-24 15:22:51 -0700 (Thu, 24 Feb 2011)
Log Message:
-----------
removing use of deprecated findstr() in favor of supported strfind()

Modified Paths:
--------------
    DART/trunk/diagnostics/matlab/link_obs.m

-------------- next part --------------
Modified: DART/trunk/diagnostics/matlab/link_obs.m
===================================================================
--- DART/trunk/diagnostics/matlab/link_obs.m	2011-02-24 20:38:08 UTC (rev 4762)
+++ DART/trunk/diagnostics/matlab/link_obs.m	2011-02-24 22:22:51 UTC (rev 4763)
@@ -73,7 +73,7 @@
 obs  = read_obs_netcdf(fname, ObsTypeString, region, ObsCopyString, QCString, verbose);
 copy = read_obs_netcdf(fname, ObsTypeString, region,    CopyString, QCString, 0);
 
-if ( length(obs.lons) == 0 )
+if ( isempty(obs.lons) )
     error('There are no %s observations in the region specified in %s', ObsTypeString, fname)
 end
 
@@ -103,7 +103,7 @@
 obsmat = zeros(length(obs.lons),9);
 obsmat(:,obs.lonindex ) = obs.lons; obs.colnames{obs.lonindex}  = 'longitude';
 obsmat(:,obs.latindex ) = obs.lats; obs.colnames{obs.latindex}  = 'latitude';
-obsmat(:,obs.zindex   ) = obs.z   ; obs.colnames{obs.zindex}    = obs.Zunits;;
+obsmat(:,obs.zindex   ) = obs.z   ; obs.colnames{obs.zindex}    = obs.Zunits;
 obsmat(:,obs.obsindex ) = obs.obs ; obs.colnames{obs.obsindex}  = ObsCopyString;
 obsmat(:,obs.copyindex) = copy.obs; obs.colnames{obs.copyindex} = CopyString;
 obsmat(:,obs.qcindex  ) = obs.qc  ; obs.colnames{obs.qcindex}   = QCString;
@@ -114,8 +114,8 @@
 %% Replace all ill-posed copies with 
 % This should really check to see if the copy is a 'mean' or 'spread' ...
 
-iscalculated = ~isempty(findstr(lower(obs.colnames{obs.copyindex}),'mean')) | ...
-               ~isempty(findstr(lower(obs.colnames{obs.copyindex}),'spread'));
+iscalculated = ~isempty(strfind(lower(obs.colnames{obs.copyindex}),'mean')) | ...
+               ~isempty(strfind(lower(obs.colnames{obs.copyindex}),'spread'));
 
 if iscalculated
    disp('replacing copies with [1 < QC flag < 5] with NaN')


More information about the Dart-dev mailing list