comparison m-toolbox/classes/@paramValue/getProperty.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % GETPROPERTY get a property to a paramValue
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: GETPROPERTY get a property to a paramValue. If the property
5 % name exists then it returns the value otherwise an empty
6 % array ([]).
7 %
8 % CALL: obj = obj.getProperty(propertyName);
9 %
10 % INPUTS: propertyName: Property name of the paramValue object
11 %
12 % VERSION: $Id: getProperty.m,v 1.1 2009/07/14 16:13:19 ingo Exp $
13 %
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
16 function val = getProperty(obj, propertyName)
17
18 if nargin ~= 2
19 error('### This method works only with two inputs.');
20 end
21
22 if isfield(obj.property, propertyName)
23 val = obj.property.(propertyName);
24 else
25 val = [];
26 end
27
28 end