1 function j=initgrad(expr,vars)
\r
2 %INITGRAD Input arguments:
\r
3 % 1) expr: A cell (char) array containing expressions
\r
4 % 2) vars: A cell (char) array containing variables
\r
6 % Calculates the jacobian of expr with respect to vars.
\r
8 % Toolbox for nonlinear filtering.
\r
9 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
11 % This program is free software; you can redistribute it and/or
\r
12 % modify it under the terms of the GNU General Public License
\r
13 % as published by the Free Software Foundation; either version 2
\r
14 % of the License, or (at your option) any later version.
\r
16 % This program is distributed in the hope that it will be useful,
\r
17 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
18 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
19 % GNU General Public License for more details.
\r
21 % You should have received a copy of the GNU General Public License
\r
22 % along with this program; if not, write to the Free Software
\r
23 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
25 expression=char2sym(removedots(convert2char(expr)));
\r
26 vars=char2sym(vars);
\r
27 j=sym2char(jacobian(expression,vars));
\r