Mercurial > hg > ltpda
comparison m-toolbox/classes/@param/getDefaultVal.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 % GETDEFAULTVAL retrurns the default value for this parameter | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: GETDEFAULTVAL retrurns the default value for this parameter | |
5 % | |
6 % CALL: val = getDefaultVal(param); | |
7 % | |
8 % | |
9 % VERSION: $Id: getDefaultVal.m,v 1.2 2011/02/22 15:41:55 hewitson Exp $ | |
10 % | |
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
12 | |
13 function varargout = getDefaultVal(varargin) | |
14 | |
15 pin = varargin{1}; | |
16 | |
17 if numel(pin) ~= 1 || nargin ~= 1 | |
18 error('### This method works only with one param object.'); | |
19 end | |
20 | |
21 if isa(pin.val, 'paramValue') | |
22 varargout{1} = pin.val.getVal; | |
23 else | |
24 varargout{1} = pin.val; | |
25 end | |
26 end |