1 ## Copyright (C) 2006,2007,2008 Carlo de Falco
3 ## This file is part of:
4 ## OCS - A Circuit Simulator for Octave
6 ## OCS is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation.
10 ## This program 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 this program (see the file LICENSE); if not,
17 ## see <http://www.gnu.org/licenses/>.
19 ## author: Carlo de Falco <cdf _AT_ users.sourceforge.net>
22 ## @deftypefn{Function File} {} utl_plot_by_name(@var{t},@var{out}, @
23 ## @var{outstruct},@var{namelist})
25 ## Select by name some elements of the state vector of the system described
26 ## by @var{outstruct} and plot their dynamics over the time interval
29 ## @var{namelist} should contain the list of names of the variables
31 ## @var{out} should be the output of a transient simulation over the
32 ## time interval @var{t}
34 ## @seealso{tst_backward_euler,tst_daspk,tst_theta_method,tst_odepkg,prs_iff}
38 function utl_plot_by_name (t, out, outstruct, namelist)
41 error ("utl_plot_by_name: wrong number of input parameters.")
44 nn = length (outstruct.namesn);
47 for in = 1:length (namelist)
48 if (strcmp (namelist{in},outstruct.namess{ip}))
49 plot (t, out(outstruct.namesn(ip), :), sprintf("%d", mod (in+1, 6) + 1));
50 leg{++ileg} = outstruct.namess{ip};