1 function plot(obj,varargin);
\r
2 % Plots the data contained in the object.
\r
4 % Syntax: (* = optional)
\r
6 % plot(ekfobj, state*, colorscheme*);
\r
7 % plot(ekfobj, states*, colorscheme*);
\r
12 % ekf object containing the data to be plotted
\r
14 % The state x(state) will be plotted, in one-dimension (using the plot1d method).
\r
16 % A pair of integers [sx, sy].
\r
17 % The x and y axes will represent x(sx) and x(sy) respectively.
\r
18 % This will result in a two-dimensional plot (using the plot2d method).
\r
20 % If ekfobj.xhat contains multiple states, 'states' is set to [1 2] and
\r
21 % the plot will be two-dimensional. If not, 'state' is set to 1 and a
\r
22 % one-dimensional plot will be done.
\r
24 % An integer that decides what colors will be used in the figure.
\r
25 % Two colors will be picked using getcolors(colorstate)
\r
27 % colorscheme is set to 1
\r
29 % Toolbox for nonlinear filtering.
\r
30 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
32 % This program is free software; you can redistribute it and/or
\r
33 % modify it under the terms of the GNU General Public License
\r
34 % as published by the Free Software Foundation; either version 2
\r
35 % of the License, or (at your option) any later version.
\r
37 % This program is distributed in the hope that it will be useful,
\r
38 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
39 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
40 % GNU General Public License for more details.
\r
42 % You should have received a copy of the GNU General Public License
\r
43 % along with this program; if not, write to the Free Software
\r
44 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
46 if isempty(obj.xhat)
\r
47 error('Object contains no data');
\r
50 states=[]; % states default (will be defined by plot1d.m / plot2d.m)
\r
52 if nargin>=2; states=varargin{1}; end;
\r
55 if size(obj.xhat,1)>1
\r
56 plot2d(obj,varargin{:});
\r
58 plot1d(obj,varargin{:});
\r
62 plot2d(obj,varargin{:});
\r
64 plot1d(obj,varargin{:});
\r