Mercurial > hg > octave-lyh
comparison scripts/image/prism.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 | 73086d4b64fa |
children | b9c02ee24de1 |
comparison
equal
deleted
inserted
replaced
14278:fa894f89b18f | 14279:f205d0074687 |
---|---|
38 endif | 38 endif |
39 else | 39 else |
40 print_usage (); | 40 print_usage (); |
41 endif | 41 endif |
42 | 42 |
43 p = [1, 0, 0; 1, 1/2, 0; 1, 1, 0; 0, 1, 0; 0, 0, 1; 2/3, 0, 1]; | 43 C = [1, 0, 0; 1, 1/2, 0; 1, 1, 0; 0, 1, 0; 0, 0, 1; 2/3, 0, 1]; |
44 | 44 map = C(rem (0:(n-1), 6) + 1, :); |
45 map = [repmat(p, fix(n/6), 1); p(1:rem (n, 6), :)]; | |
46 | 45 |
47 endfunction | 46 endfunction |
48 | 47 |
49 | 48 |
50 %!demo | 49 %!demo |