Mercurial > hg > octave-lojdl
changeset 14369:932ba2bb9060
rainbow.m: Reformat and fix typo (bug #35549)
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 16 Feb 2012 16:17:06 -0500 |
parents | 5736d93b22d0 |
children | fbdee844550c |
files | scripts/image/rainbow.m |
diffstat | 1 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/rainbow.m +++ b/scripts/image/rainbow.m @@ -47,14 +47,18 @@ map = [1, 0, 0]; elseif (n > 1) x = linspace (0, 1, n)'; - r = (x < 2/5) ... - + (x >= 2/5 & x < 3/5) .* (-5 * x + 3) ... - + (x >= 4/5) .* (10/3 * x - 8/3); - g = (x < 2/5) .* (5/2 * x) ... - + (x >= 2/5 & x < 3/5) ... - + (x >= 3/5 & x < 4/5) .* (-5 * x + 4); - b = (x >= 3/5 & x < 4/5) .* (5 * x - 3) - + (x >= 4/5); + + r = (x < 2/5) \ + + (x >= 2/5 & x < 3/5) .* (-5 * x + 3) \ + + (x >= 4/5) .* (10/3 * x - 8/3); + + g = (x < 2/5) .* (5/2 * x) \ + + (x >= 2/5 & x < 3/5) \ + + (x >= 3/5 & x < 4/5) .* (-5 * x + 4); + + b = (x >= 3/5 & x < 4/5) .* (5 * x - 3) \ + + (x >= 4/5); + map = [r, g, b]; else map = [];