xxsimGetValue - gets specified values. Syntax: retval = xxsimGetValue('varName') Inputs: varName = name of a variable including hierarchy e.g 'PID.Kd' reads variable 'Kd' in submodel 'PID'. Outputs: retval = value of the requested variable. Examples: retval = xxsimGetValue('time') Get the current value for the variable time. See also: xxsimGetVariables Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl September 2013
0001 function retval = xxsimGetValue(varName) 0002 % xxsimGetValue - gets specified values. 0003 % 0004 % Syntax: 0005 % retval = xxsimGetValue('varName') 0006 % 0007 % Inputs: 0008 % varName = name of a variable including hierarchy 0009 % e.g 'PID.Kd' reads variable 'Kd' in submodel 'PID'. 0010 % 0011 % Outputs: 0012 % retval = value of the requested variable. 0013 % 0014 % Examples: 0015 % retval = xxsimGetValue('time') 0016 % Get the current value for the variable time. 0017 % 0018 % See also: xxsimGetVariables 0019 % 0020 % Author: Controllab Products B.V. 0021 % email: info@controllab.nl 0022 % Website: http://www.controllab.nl 0023 % September 2013 0024 0025 %------------- BEGIN CODE -------------- 0026 %check input arguments 0027 if ~ischar(varName) 0028 error('Argument not a string'); 0029 end 0030 0031 retvalStr = xxsimGetVariables(varName); 0032 retval = retvalStr.values; 0033 0034 end 0035 %------------- END OF CODE --------------