1 ## Copyright (C) 2010, 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{a}, @var{b}, @var{c}, @var{d}, @var{e}, @var{tsam}] =} dssdata (@var{sys})
20 ## @deftypefnx {Function File} {[@var{a}, @var{b}, @var{c}, @var{d}, @var{e}, @var{tsam}] =} dssdata (@var{sys}, @var{[]})
21 ## Access descriptor state-space model data.
22 ## Argument @var{sys} is not limited to descriptor state-space models.
23 ## If @var{sys} is not a descriptor state-space model, it is converted automatically.
28 ## Any type of LTI model.
30 ## In case @var{sys} is not a dss model (descriptor matrix @var{e} empty),
31 ## @code{dssdata (sys, [])} returns the empty element @code{e = []} whereas
32 ## @code{dssdata (sys)} returns the identity matrix @code{e = eye (size (a))}.
38 ## State transition matrix (n-by-n).
40 ## Input matrix (n-by-m).
42 ## Measurement matrix (p-by-n).
44 ## Feedthrough matrix (p-by-m).
46 ## Descriptor matrix (n-by-n).
48 ## Sampling time in seconds. If @var{sys} is a continuous-time model,
49 ## a zero is returned.
53 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
54 ## Created: September 2010
57 function [a, b, c, d, e, tsam, scaled] = dssdata (sys, flg = 0)
59 ## NOTE: In case sys is not a dss model (matrice e empty),
60 ## dssdata (sys, []) returns e = [] whereas
61 ## dssdata (sys) returns e = eye (size (a))
67 if (! isa (sys, "ss"))
71 [a, b, c, d, e, ~, scaled] = __sys_data__ (sys);
73 if (isempty (e) && ! isempty (flg))
74 e = eye (size (a)); # return eye for ss models