maxnan.m
changeset 0 0a450563f904
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/maxnan.m	Tue Oct 20 16:23:49 2009 -0400
@@ -0,0 +1,15 @@
+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);
+
+