maxnan.m
author A.M. Thurnherr <ant@ldeo.columbia.edu>
Tue, 08 Jul 2014 21:50:22 -0400
changeset 14 f7f35d9629ab
parent 0 0a450563f904
permissions -rw-r--r--
version used on FZ1

function [m,k]=maxnan(data);
% function [m,k]=maxnan(data);
%
% calculates max values similar to built-in 'max' 
% but takes NaN's into account
% by first substituing them with -Inf and then calling the bilt-in max 

% Uwe Send, IfM Kiel, Jun 1993
% last change 24 Jun 1993

l=find(isnan(data));
data(l)=-inf*ones(length(l),1);
[m,k]=max(data);