Mercurial > hg > octave-nkf
changeset 15899:f59797321a1b
perms.m: Match documentation variable names to function variable names.
* perms.m: Match documentation variable names to function variable names.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 04 Jan 2013 14:14:41 -0800 |
parents | a7d89366d7ed |
children | 80e99730e5d4 |
files | scripts/specfun/perms.m |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/specfun/perms.m +++ b/scripts/specfun/perms.m @@ -38,17 +38,17 @@ ## @end example ## @end deftypefn -function A = perms (w) +function A = perms (v) if (nargin != 1) print_usage (); endif - v = [1:length(w)]'; - n = length (v); + vidx = [1:length(v)]'; + n = length (vidx); if (n == 0) p = []; else - p = v(1); + p = vidx(1); for j = 2:n B = p; p = zeros (prod (2:j), n); @@ -56,13 +56,13 @@ idx = 1:k; for i = j:-1:1 p(idx,1:i-1) = B(:,1:i-1); - p(idx,i) = v(j); + p(idx,i) = vidx(j); p(idx,i+1:j) = B(:,i:j-1); idx += k; endfor endfor endif - A = w(p); + A = v(p); endfunction