xxsimGetLogValues

PURPOSE ^

xxsimGetLogValues - Fetch the values which are logged using xxsimSetLogVariables.

SYNOPSIS ^

function [values, names] = xxsimGetLogValues(logVariables)

DESCRIPTION ^

 xxsimGetLogValues - Fetch the values which are logged using xxsimSetLogVariables.

 Syntax: 
   [values, names] = xxsimGetLogValues(logVariables)

 Inputs:
   logVariables = list of variables e.g {'time', 'LogVarTest.v1'}.
                  Note: Use xxsimSetLogVariables() first to tell 20-sim which variables should be logged.
                  The list of variable may contain plot variables as well.
 Outputs: 
   values = returns an array of the requested variables.
   names = returns a structure array of the requested variables.

 Examples:
    [values, names] = xxsimGetLogValues({'time','Rotation.x'});
        - Gets the log values for the logging variables time and Rotation.x.

 See also: xxsimSetLogVariables

 Author: Controllab Products B.V.
 email: info@controllab.nl
 Website: http://www.controllab.nl
 September 2013

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [values, names] = xxsimGetLogValues(logVariables)
0002 % xxsimGetLogValues - Fetch the values which are logged using xxsimSetLogVariables.
0003 %
0004 % Syntax:
0005 %   [values, names] = xxsimGetLogValues(logVariables)
0006 %
0007 % Inputs:
0008 %   logVariables = list of variables e.g {'time', 'LogVarTest.v1'}.
0009 %                  Note: Use xxsimSetLogVariables() first to tell 20-sim which variables should be logged.
0010 %                  The list of variable may contain plot variables as well.
0011 % Outputs:
0012 %   values = returns an array of the requested variables.
0013 %   names = returns a structure array of the requested variables.
0014 %
0015 % Examples:
0016 %    [values, names] = xxsimGetLogValues({'time','Rotation.x'});
0017 %        - Gets the log values for the logging variables time and Rotation.x.
0018 %
0019 % See also: xxsimSetLogVariables
0020 %
0021 % Author: Controllab Products B.V.
0022 % email: info@controllab.nl
0023 % Website: http://www.controllab.nl
0024 % September 2013
0025 
0026 %------------- BEGIN CODE --------------
0027 
0028     if iscell(logVariables)
0029         callStruct = logVariables;
0030     else
0031         callStruct = {logVariables};
0032     end
0033 
0034     logValues = xrlinvoke('xxsim.simulator.getLogValues', struct('variables', {{ callStruct, 'array' }} )  );
0035     
0036     
0037     values = [];
0038     names = {};
0039     
0040     for(i=1:length(logValues))
0041         names{i} = logValues(i).name;
0042         values = [values , logValues(i).values];    
0043     end
0044     
0045     %if ~isfield(logValues, 'name')
0046     %    error('could not retrieve log values');
0047     %end
0048     %if ~isfield(logValues, 'values')
0049     %    error('could not retrieve log values');
0050     %end
0051 end
0052 %------------- END OF CODE --------------

Generated on Sun 10-Dec-2017 19:24:51