changeset 550:d6a7e7268581

im2double: fix small bug where isind would be called wrongly
author carandraug
date Wed, 11 Apr 2012 17:13:27 +0000
parents 7dbbeef84707
children 26f74317f196
files inst/im2double.m
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/inst/im2double.m
+++ b/inst/im2double.m
@@ -36,10 +36,10 @@
 ## @seealso{im2bw, im2uint16, im2uint8}
 ## @end deftypefn
 
-function im = im2double (im, ind = false)
+function im = im2double (im, indexed = false)
 
   ## Input checking (private function that is used for all im2class functions)
-  im_class = imconversion (nargin, "im2double", ind, im);
+  im_class = imconversion (nargin, "im2double", indexed, im);
 
   switch im_class
     case "double"
@@ -47,9 +47,9 @@
     case {"logical", "single"}
       im = double (im);
     case {"uint8", "uint16"}
-      if (ind)
+      if (indexed)
         im = double (im) + 1;
-      elseif (isind (im))
+      else
         im = double (im) / double (intmax (im_class));
       endif
     case "int16"