1## Copyright (C) 2009-2016   Lukas F. Reichlin
2##
3## This file is part of LTI Syncope.
4##
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.
9##
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.
14##
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/>.
17
18## -*- texinfo -*-
19## @deftypefn {Function File} {[@var{keys}, @var{vals}] =} __iddata_keys__ (@var{dat})
20## Return the list of keys as well as the assignable values for an iddata set.
21## @end deftypefn
22
23## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
24## Created: February 2012
25## Version: 0.2
26
27function [keys, vals] = __iddata_keys__ (dat, aliases = false)
28
29  [n, p, m, e] = size (dat);
30
31  ## cell vector of iddata-specific keys
32  keys = {"y";
33          "outname";
34          "outunit";
35          "u";
36          "inname";
37          "inunit";
38          "tsam";
39          "timeunit";
40          "expname";
41          "name";
42          "notes";
43          "userdata"};
44
45  ## cell vector of iddata-specific assignable values
46  vals = {sprintf("(%dx1) cell vector of (nx%d) matrices", e, p);
47          sprintf("(%dx1) cell vector of strings", p);
48          sprintf("(%dx1) cell vector of strings", p);
49          sprintf("(%dx1) cell vector of (nx%d) matrices", e, m);
50          sprintf("(%dx1) cell vector of strings", m);
51          sprintf("(%dx1) cell vector of strings", m);
52          sprintf("(%dx1) cell vector of scalars", e);
53          "string";
54          sprintf("(%dx1) cell vector of strings", e);
55          "string";
56          "string or cell of strings";
57          "any data type"};
58
59  if (aliases)
60    ka = {"outdata";
61          "outputdata";
62          "outputname";
63          "outputunit";
64          "indata";
65          "inputdata";
66          "inputname";
67          "inputunit";
68          "experimentname";
69          "w";
70          "frequency";
71          "samplinginstants";
72          "domain";
73          "timedomain"};
74
75    keys = [keys; ka];
76  endif
77
78endfunction
79