changeset 6967:65a28e9de0a5

[project @ 2007-10-06 12:47:11 by jwe]
author jwe
date Sat, 06 Oct 2007 12:49:25 +0000
parents da6659f222a6
children c8fc3487ed2c
files scripts/ChangeLog scripts/general/__splinen__.m scripts/general/isscalar.m scripts/general/rat.m scripts/image/__img_via_file__.m scripts/image/saveimage.m scripts/strings/dec2base.m
diffstat 7 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/ChangeLog	Sat Oct 06 12:49:25 2007 +0000
@@ -1,3 +1,13 @@
+2007-10-06  Søren Hauberg  <hauberg@gmail.com>
+
+	* image/saveimage.m: Handle saving color images without a colormap.
+	* image/__img_via_file__.m: Add missing semicolon.
+
+2007-10-06  Bill Denney  <wsloand@gmail.com>
+
+        * general/__splinen__.m, general/isscalar.m, general/rat.m,
+	strings/dec2base.m: Use numel(x) instead of prod(size(x)).
+
 2007-10-06  Francesco Potorti`  <Potorti@isti.cnr.it>
 
 	* plot/print.m: Handle svg output type.  Accept new -S option to
--- a/scripts/general/__splinen__.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/general/__splinen__.m	Sat Oct 06 12:49:25 2007 +0000
@@ -30,7 +30,7 @@
   if (nargin != 5)
     error ("Incorrect number of arguments");
   endif
-  isvec = @(x) prod(size(x)) == length(x);   # ND isvector function
+  isvec = @(x) numel (x) == length (x);   # ND isvector function
   if (!iscell (x) || length(x) < ndims(y) || any (! cellfun (isvec, x)) ||
       !iscell (xi) || length(xi) < ndims(y) || any (! cellfun (isvec, xi)))
     error ("%s: non gridded data or dimensions inconsistent", f);
--- a/scripts/general/isscalar.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/general/isscalar.m	Sat Oct 06 12:49:25 2007 +0000
@@ -28,7 +28,7 @@
 function retval = isscalar (x)
 
   if (nargin == 1)
-    retval = prod (size (x)) == 1;
+    retval = numel (x) == 1;
   else
     print_usage ();
   endif
--- a/scripts/general/rat.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/general/rat.m	Sat Oct 06 12:49:25 2007 +0000
@@ -58,7 +58,7 @@
   lastd = zeros(size(y));
 
   nd = ndims(y);
-  nsz = prod (size (y));
+  nsz = numel (y);
   steps = zeros([nsz, 0]);
 
   ## grab new factors until all continued fractions converge
--- a/scripts/image/__img_via_file__.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/image/__img_via_file__.m	Sat Oct 06 12:49:25 2007 +0000
@@ -55,7 +55,7 @@
     else
       command = sprintf (command, ppm_name);
     endif
-    status = system (sprintf ("( %s && %s) > /dev/null 2>&1 &", command, rm))
+    status = system (sprintf ("( %s && %s) > /dev/null 2>&1 &", command, rm));
   endif
   
   ## Did the system call fail?
--- a/scripts/image/saveimage.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/image/saveimage.m	Sat Oct 06 12:49:25 2007 +0000
@@ -81,7 +81,11 @@
   endif
 
   if (nargin < 4)
-    map = colormap ();
+    if (size(img, 3) == 3)
+      [img, map] = rgb2ind(img);
+    else
+      map = colormap ();
+    endif
   endif
 
   [map_nr, map_nc] = size (map);
--- a/scripts/strings/dec2base.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/strings/dec2base.m	Sat Oct 06 12:49:25 2007 +0000
@@ -53,7 +53,7 @@
     print_usage ();
   endif
 
-  if (prod (size (n)) != length (n))
+  if (numel (n) != length (n))
     n = n(:);
   elseif (any (n < 0 | n != fix (n)))
     error ("dec2base: can only convert non-negative integers")