xxsimClearRun - Clears one or more runs. Syntax: result = xxsimClearRun(action) Inputs: action = integer indicating what action to take: 0 = clear all runs (also default if argument is omitted). 1 = clear last run. 2 = clear previous runs. Outputs: result = boolean indicating the success. Examples: result = xxsimClearRun(0) - clears all runs. Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl November 2015
0001 function [result] = xxsimClearRun(varargin) 0002 % xxsimClearRun - Clears one or more runs. 0003 % 0004 % Syntax: 0005 % result = xxsimClearRun(action) 0006 % 0007 % Inputs: 0008 % action = integer indicating what action to take: 0009 % 0 = clear all runs (also default if argument is omitted). 0010 % 1 = clear last run. 0011 % 2 = clear previous runs. 0012 % 0013 % Outputs: 0014 % result = boolean indicating the success. 0015 % 0016 % Examples: 0017 % result = xxsimClearRun(0) 0018 % 0019 % - clears all runs. 0020 % 0021 % Author: Controllab Products B.V. 0022 % email: info@controllab.nl 0023 % Website: http://www.controllab.nl 0024 % November 2015 0025 0026 %------------- BEGIN CODE -------------- 0027 %check input arguments 0028 clear = int32(0); 0029 if length(varargin)==1 0030 0031 if ~isnumeric(varargin{1}) 0032 error('Input argument 1 should be a number. See help xxsimClearRun.'); 0033 else 0034 % always cast to an integer 0035 clear = int32(varargin{1}); 0036 end 0037 elseif length(varargin)>1 0038 error('Too many input arguments: xxsimClearRun expects 1 (optional) input argument.'); 0039 end 0040 0041 % set the result variable 0042 result = xrlinvoke('xxsim.simulator.clearRun', struct('clear', int32(clear))); 0043 end 0044 %------------- END OF CODE --------------