# HG changeset patch # User jwe # Date 1155580875 0 # Node ID 87fcda0eda046216dacb5fedf71e020fa05691f7 # Parent 611e30b984b31585db72f5ea1ce51c0f5f1daf66 [project @ 2006-08-14 18:41:15 by jwe] diff -r 611e30b984b3 -r 87fcda0eda04 scripts/ChangeLog --- a/scripts/ChangeLog Mon Aug 14 18:29:18 2006 +0000 +++ b/scripts/ChangeLog Mon Aug 14 18:41:15 2006 +0000 @@ -1,5 +1,7 @@ 2006-08-14 Søren Hauberg + * strings/bin2dec.m: Ignore spaces in input for compatibility. + * colormap.m: Change global variable to persistent. * rgb2ind.m: Handle single 3-d array as rgb image. diff -r 611e30b984b3 -r 87fcda0eda04 scripts/strings/bin2dec.m --- a/scripts/strings/bin2dec.m Mon Aug 14 18:29:18 2006 +0000 +++ b/scripts/strings/bin2dec.m Mon Aug 14 18:41:15 2006 +0000 @@ -37,10 +37,16 @@ function d = bin2dec (h) - if (nargin != 1) - usage ("bin2dec (b)"); + if (nargin == 1 && ischar (h)) + n = rows (h); + d = zeros (n, 1); + for i = 1:n + s = h(i,:); + s = s(! isspace (s)); + d(i) = base2dec (s, 2); + endfor else - d = base2dec (h, 2); + print_usage (); endif endfunction