1 function newexpr=initdata(expr, xvars, uvars, wvars, evalvar);
\r
2 % Assigns the expression to the appropriate data object. If an unknown expression type
\r
3 % (such as a custom data object) is given, it will be returned without modifications.
\r
5 % Syntax: (* = optional)
\r
7 % dataobj = initdata(expr, xvars, wvars, uvars, evalvar);
\r
14 % A cell (char) array containing the state variables
\r
16 % A cell (char) array containing the u(t) variables
\r
18 % A cell (char) array containing the w(t) variables
\r
20 % Some data objects, such as xlinear that use matrix multiplication, don't support
\r
21 % xvars, uvars and wvars. These objects need to know what variable(s) to use in the
\r
22 % evaluation. 'evalvar' contains this information. evalvar=1 means that x will be used in
\r
23 % the evaluation. evalvar=[1 3] means that [x; u] will be used (x and u are, like always,
\r
24 % row vectors or scalars). evalvar=0 means that no variable is used.
\r
25 % For arguments that uses xvars, uvars and wvars, this argument is redundant.
\r
26 % Example - the eval command of xlinear ('expression' is a matrix):
\r
27 % evalvar=0 returns expression
\r
28 % evalvar=1 returns expression*x
\r
29 % evalvar=[1 3 2] returns expression*[x; u; w]
\r
34 % The resulting data object.
\r
36 % Toolbox for nonlinear filtering.
\r
37 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
39 % This program is free software; you can redistribute it and/or
\r
40 % modify it under the terms of the GNU General Public License
\r
41 % as published by the Free Software Foundation; either version 2
\r
42 % of the License, or (at your option) any later version.
\r
44 % This program is distributed in the hope that it will be useful,
\r
45 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
46 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
47 % GNU General Public License for more details.
\r
49 % You should have received a copy of the GNU General Public License
\r
50 % along with this program; if not, write to the Free Software
\r
51 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
55 newexpr=xsymbolic(expr,xvars,uvars,wvars);
\r
57 newexpr=xsymbolic(expr,xvars,uvars,wvars);
\r
59 newexpr=xsymbolic(expr,xvars,uvars,wvars);
\r
61 newexpr=xsymbolic(expr,xvars,uvars,wvars);
\r
63 newexpr=xlinear(expr,evalvar);
\r