comparison scripts/image/summer.m @ 11587:c792872f8942

all script files: untabify and strip trailing whitespace
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:35:29 -0500
parents fd0a3ac60b0e
children 72c96de7a403
comparison
equal deleted inserted replaced
11586:12df7854fa7c 11587:c792872f8942
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {@var{map} =} summer () 20 ## @deftypefn {Function File} {@var{map} =} summer ()
21 ## @deftypefnx {Function File} {@var{map} =} summer (@var{n}) 21 ## @deftypefnx {Function File} {@var{map} =} summer (@var{n})
22 ## Create color colormap. This colormap varies from green to yellow. 22 ## Create color colormap. This colormap varies from green to yellow.
23 ## The argument @var{n} must be a scalar. 23 ## The argument @var{n} must be a scalar.
24 ## If unspecified, the length of the current colormap, or 64, is used. 24 ## If unspecified, the length of the current colormap, or 64, is used.
25 ## @seealso{colormap} 25 ## @seealso{colormap}
26 ## @end deftypefn 26 ## @end deftypefn
27 27
28 ## Author: Kai Habel <kai.habel@gmx.de> 28 ## Author: Kai Habel <kai.habel@gmx.de>
38 else 38 else
39 print_usage (); 39 print_usage ();
40 endif 40 endif
41 41
42 if (n == 1) 42 if (n == 1)
43 map = [0, 0.5, 0.4]; 43 map = [0, 0.5, 0.4];
44 elseif (n > 1) 44 elseif (n > 1)
45 r = (0:n - 1)' ./ (n - 1); 45 r = (0:n - 1)' ./ (n - 1);
46 g = 0.5 + r ./ 2; 46 g = 0.5 + r ./ 2;
47 b = 0.4 * ones (n, 1); 47 b = 0.4 * ones (n, 1);
48 48