diff scripts/image/imshow.m @ 6219:ba9db82d85a8

[project @ 2006-12-27 17:53:34 by jwe]
author jwe
date Wed, 27 Dec 2006 17:53:34 +0000
parents 045038e0108a
children 6a60e68fc4b1
line wrap: on
line diff
--- a/scripts/image/imshow.m
+++ b/scripts/image/imshow.m
@@ -130,6 +130,13 @@
     im = real (im);
   endif
   
+  nans = isnan (im(:));
+  if (any (nans))
+    warning ("Octave:imshow-NaN",
+	     "imshow: pixel with NaN or NA values are set to zero");
+    im(nans) = display_range(1);
+  endif
+
   ## Scale the image to the interval [0, 1] according to display_range.
   if (! isindexed)
     low = display_range(1);