diff scripts/image/winter.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
line wrap: on
line diff
--- a/scripts/image/winter.m	Sun Jan 29 00:52:19 2012 -0500
+++ b/scripts/image/winter.m	Sat Jan 28 22:33:57 2012 -0800
@@ -43,9 +43,8 @@
     map = [0, 0, 1];
   elseif (n > 1)
     r = zeros (n, 1);
-    g = (0:n - 1)' ./ (n - 1);
-    b = 1 - g ./ 2;
-
+    g = [0:(n-1)]' / (n - 1);
+    b = 1 - g / 2;
     map = [r, g, b];
   else
     map = [];