Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@paramValue/getProperty.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,28 @@ +% GETPROPERTY get a property to a paramValue +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: GETPROPERTY get a property to a paramValue. If the property +% name exists then it returns the value otherwise an empty +% array ([]). +% +% CALL: obj = obj.getProperty(propertyName); +% +% INPUTS: propertyName: Property name of the paramValue object +% +% VERSION: $Id: getProperty.m,v 1.1 2009/07/14 16:13:19 ingo Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function val = getProperty(obj, propertyName) + + if nargin ~= 2 + error('### This method works only with two inputs.'); + end + + if isfield(obj.property, propertyName) + val = obj.property.(propertyName); + else + val = []; + end + +end