Home > utilities > zero_to_nan.m

zero_to_nan

PURPOSE ^

SYNOPSIS ^

function array = zero_to_nan(array)

DESCRIPTION ^

 Replaces values of zero with NaN.

 Author(s)
    Pierre Cazenave (Plymouth Marine Laboratory)

 Revision history
    2017-03-27 Removed the loops and used logical indexing instead.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function array = zero_to_nan(array)
0002 %
0003 % Replaces values of zero with NaN.
0004 %
0005 % Author(s)
0006 %    Pierre Cazenave (Plymouth Marine Laboratory)
0007 %
0008 % Revision history
0009 %    2017-03-27 Removed the loops and used logical indexing instead.
0010 
0011 array(array == 0) = nan;

Generated on Wed 20-Feb-2019 16:06:01 by m2html © 2005