1 ## Copyright (C) 2009, 2011 Lukas F. Reichlin
3 ## This file is part of LTI Syncope.
5 ## LTI Syncope is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, either version 3 of the License, or
8 ## (at your option) any later version.
10 ## LTI Syncope is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>.
19 ## @deftypefn {Function File} {@var{nvec} =} size (@var{sys})
20 ## @deftypefnx {Function File} {@var{n} =} size (@var{sys}, @var{dim})
21 ## @deftypefnx {Function File} {[@var{p}, @var{m}] =} size (@var{sys})
22 ## LTI model size, i.e. number of outputs and inputs.
29 ## If given a second argument, @command{size} will return the size of the
30 ## corresponding dimension.
36 ## Row vector. The first element is the number of outputs (rows) and the second
37 ## element the number of inputs (columns).
39 ## Scalar value. The size of the dimension @var{dim}.
47 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
48 ## Created: September 2009
51 function [n, varargout] = size (sys, dim = 0)
57 p = numel (sys.outname); # WARNING: system matrices may change without
58 m = numel (sys.inname); # being noticed by the i/o names!
74 disp (sprintf ("LTI model with %d output%s and %d input%s.", p, stry, m, stru));