Commit 9f117f9d authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Changed behaviour of @dynSeries/size.

If called with a second input argument (dim), size returns the number of observations if dim==1 or
the number of variables if dim==2. Without this second argument, size returns the number of
observations and the number of variables.
parent 077f9844
function [a,b] = size(c)
function [a,b] = size(c,dim)
% Copyright (C) 2013 Dynare Team
%
......@@ -18,4 +18,21 @@ function [a,b] = size(c)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
a = c.nobs;
b = c.vobs;
\ No newline at end of file
b = c.vobs;
if nargin>1
if nargout>1
error('dynSeries::size: Wrong calling sequence!')
end
switch dim
case 1
a = c.nobs;
case 2
a = c.vobs;
otherwise
error(['dynSeries::size: Wrong calling sequence! Argument ''' inputname(2) ''' must be equal to 1 or 2.' ])
end
else
a = c.nobs;
b = c.vobs;
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment