xxsimGotoSubmodel - Select the provided submodel in the tree and show its contents Syntax: result = xxsimGotoSubmodel(submodelName) Inputs: submodelName = the hierachical submodel name Outputs: result = boolean indicating the success. Examples: result = xxsimGotoSubmodel('mysubmodel') Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl May 2016
0001 function [result] = xxsimGotoSubmodel(varargin) 0002 % xxsimGotoSubmodel - Select the provided submodel in the tree and show its contents 0003 % 0004 % Syntax: 0005 % result = xxsimGotoSubmodel(submodelName) 0006 % 0007 % Inputs: 0008 % submodelName = the hierachical submodel name 0009 % 0010 % Outputs: 0011 % result = boolean indicating the success. 0012 % 0013 % Examples: 0014 % result = xxsimGotoSubmodel('mysubmodel') 0015 % 0016 % Author: Controllab Products B.V. 0017 % email: info@controllab.nl 0018 % Website: http://www.controllab.nl 0019 % May 2016 0020 0021 %------------- BEGIN CODE -------------- 0022 %check input arguments 0023 modelFilename = ''; 0024 if length(varargin)==1 0025 if ~ischar(varargin{1}) 0026 error('Input argument 1 should be the name of the submodel (string).'); 0027 else 0028 submodelName = varargin{1}; 0029 end 0030 else 0031 error('This function expects 1 input argument: submodelName.'); 0032 end 0033 0034 % set the result varaible 0035 result = true; 0036 0037 reply = xrlinvoke('xxsim.gui.gotoSubmodel', struct('submodelName', submodelName)); 0038 if (length(reply) == 0 ) 0039 error('could not find or select the submodel'); 0040 end 0041 0042 % return the succes 0043 result = true; 0044 end 0045 %------------- END OF CODE --------------