Mercurial > hg > octave-lyh
diff scripts/special-matrix/pascal.m @ 13904:1c06f3713e0a
* pascal.m: Style fixes.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 21 Nov 2011 16:36:20 -0500 |
parents | 3af19cfc2e0f |
children | 755f6b340453 |
line wrap: on
line diff
--- a/scripts/special-matrix/pascal.m +++ b/scripts/special-matrix/pascal.m @@ -53,11 +53,11 @@ if (t == -1) for j = 2:n - retval(j:n,j) = cumsum ( retval(j-1:n-1,j-1) ); + retval(j:n,j) = cumsum (retval(j-1:n-1,j-1)); endfor else for j = 2:n - retval(j:n,j) = -cumsum ( retval(j-1:n-1,j-1) ); + retval(j:n,j) = -cumsum (retval(j-1:n-1,j-1)); endfor endif @@ -66,7 +66,7 @@ elseif (t == 2) retval = rot90 (retval, 3); if (rem (n,2) != 1) - retval *= -1; + retval = -retval; endif endif