Mercurial > hg > octave-thorsten
changeset 14254:73086d4b64fa
prism.m: Simplify code by using repmat rather than kron.
* prism.m: Simplify code by using repmat rather than kron.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 22 Jan 2012 22:57:56 -0800 |
parents | f9bd63f5ddd0 |
children | 5cc69bafe3b9 |
files | scripts/image/prism.m |
diffstat | 1 files changed, 1 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/prism.m +++ b/scripts/image/prism.m @@ -42,11 +42,7 @@ p = [1, 0, 0; 1, 1/2, 0; 1, 1, 0; 0, 1, 0; 0, 0, 1; 2/3, 0, 1]; - if (rem (n, 6) == 0) - map = kron(ones (fix (n / 6), 1), p); - else - map = [kron(ones (fix (n / 6), 1), p); p(1:rem (n, 6), :)]; - endif + map = [repmat(p, fix(n/6), 1); p(1:rem (n, 6), :)]; endfunction