1 function v = get(obj,varargin)
\r
2 % Accesses the properties of an object.
\r
4 % value = get(obj, 'propertyname') returns the value of the specified property of the
\r
7 % An equivalent syntax is value = obj.propertyname.
\r
9 % get(obj) displays all properties of obj and their values.
\r
11 % Type 'props(obj)' for more details on the properties of the object 'obj'.
\r
13 % Toolbox for nonlinear filtering.
\r
14 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
16 % This program is free software; you can redistribute it and/or
\r
17 % modify it under the terms of the GNU General Public License
\r
18 % as published by the Free Software Foundation; either version 2
\r
19 % of the License, or (at your option) any later version.
\r
21 % This program is distributed in the hope that it will be useful,
\r
22 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
23 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
24 % GNU General Public License for more details.
\r
26 % You should have received a copy of the GNU General Public License
\r
27 % along with this program; if not, write to the Free Software
\r
28 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
31 error(nargchk(1,2,nargin));
\r
32 prop_name=varargin{1};
\r
36 % Here we handle properties that need custom treatment (or need to be
\r
37 % processed really fast)
\r
42 [props,rprops]=pnames;
\r
43 if findcstr(props,prop_name)||findcstr(rprops,prop_name)
\r
44 eval(strcat('v=obj.',prop_name,';'));
\r
46 error([prop_name,' is not a valid property'])
\r