maxnan.m
author A.M. Thurnherr <athurnherr@yahoo.com>
Mon, 23 Feb 2015 09:19:46 +0000
changeset 15 3746197831db
parent 0 0a450563f904
permissions -rw-r--r--
IX11beta for CLIVAR P16

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);