changeset 5923:611e30b984b3

[project @ 2006-08-14 18:29:18 by jwe]
author jwe
date Mon, 14 Aug 2006 18:29:18 +0000
parents 1748af819fbb
children 87fcda0eda04
files scripts/ChangeLog scripts/image/colormap.m
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,5 +1,7 @@
 2006-08-14  Søren Hauberg  <hauberg@gmail.com>
 
+        * colormap.m: Change global variable to persistent.
+
 	* rgb2ind.m: Handle single 3-d array as rgb image.
 
 2006-08-14  John W. Eaton  <jwe@octave.org>
--- a/scripts/image/colormap.m
+++ b/scripts/image/colormap.m
@@ -39,10 +39,10 @@
 
 function cmap = colormap (map)
 
-  global __current_color_map__ = gray ();
+  persistent current_color_map = gray ();
 
   if (nargin > 1)
-    usage ("colormap (map)");
+    print_usage ();
   endif
 
   if (nargin == 1)
@@ -63,12 +63,12 @@
         error ("colormap: map must have values in [0,1]");
       endif
       ## Set the new color map
-      __current_color_map__ = map;
+      current_color_map = map;
     endif
 
   endif
 
   ## Return current color map.
-  cmap = __current_color_map__;
+  cmap = current_color_map;
 
 endfunction