Mercurial > hg > ishara
annotate general/arrutils/paren.m @ 54:9bcf5e133bf0
Added from old stats library.
author | samer |
---|---|
date | Mon, 23 Feb 2015 16:08:09 +0000 |
parents | e44f49929e56 |
children |
rev | line source |
---|---|
samer@4 | 1 function Y=paren(X,varargin) |
samer@4 | 2 % paren - array dereferencing as a function |
samer@4 | 3 % |
samer@4 | 4 % See also SUBS: paren also accepts ':' and 'end' |
samer@4 | 5 |
samer@4 | 6 n=length(varargin); |
samer@4 | 7 for i=1:n |
samer@4 | 8 if strcmp(varargin{i},'end') |
samer@4 | 9 varargin{i}=size(X,i); |
samer@4 | 10 end |
samer@4 | 11 end |
samer@4 | 12 Y=X(varargin{:}); |