comparison scripts/image/autumn.m @ 14279:f205d0074687

Update colormap files with faster code. * autumn.m, bone.m, cool.m, copper.m, flag.m, gmap40.m, gray.m, hot.m, hsv.m, jet.m, lines.m, ocean.m, pink.m, prism.m, rainbow.m, spring.m, summer.m, white.m, winter.m: Use indexing in place of kron or repmat for faster code.
author Rik <octave@nomad.inbox5.com>
date Sat, 28 Jan 2012 22:33:57 -0800
parents 11949c9795a0
children b9c02ee24de1
comparison
equal deleted inserted replaced
14278:fa894f89b18f 14279:f205d0074687
42 42
43 if (n == 1) 43 if (n == 1)
44 map = [1, 0, 0]; 44 map = [1, 0, 0];
45 elseif (n > 1) 45 elseif (n > 1)
46 r = ones (n, 1); 46 r = ones (n, 1);
47 g = (0:n - 1)' ./ (n - 1); 47 g = [0:(n-1)]' / (n - 1);
48 b = zeros (n, 1); 48 b = zeros (n, 1);
49 map = [r, g, b]; 49 map = [r, g, b];
50 else 50 else
51 map = []; 51 map = [];
52 endif 52 endif