comparison scripts/image/hot.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 = [0, 0, 0]; 44 map = [0, 0, 0];
45 elseif (n > 1) 45 elseif (n > 1)
46 x = linspace (0, 1, n)'; 46 x = linspace (0, 1, n)';
47 r = (x < 2/5) .* (5/2 * x) + (x >= 2/5); 47 r = (x < 2/5) .* (5/2 * x) ...
48 g = (x >= 2/5 & x < 4/5) .* (5/2 * x - 1) + (x >= 4/5); 48 + (x >= 2/5);
49 b = (x >= 4/5) .* (5*x - 4); 49 g = (x >= 2/5 & x < 4/5) .* (5/2 * x - 1) ...
50 + (x >= 4/5);
51 b = (x >= 4/5) .* (5 * x - 4);
50 map = [r, g, b]; 52 map = [r, g, b];
51 else 53 else
52 map = []; 54 map = [];
53 endif 55 endif
54 56