| Contents | Index |
This component evaluates a specified MATLAB expression. You can include code and/or command-line output in the report.
Insert MATLAB expression in report: Causes the MATLAB expression that this component evaluates to appear in the report.
Display command window output in report: Includes the command window output that results from the evaluation of the specified MATLAB expression.
Expression to evaluate in the base workspace: Specifies the expression to evaluate in the MATLAB workspace. You can include this attribute in a loop component to obtain a handle to the object in whose context the loop is executing. For example:
Enter the following if you want to obtain a handle to the block in whose context a Block Loop is executing:
%Access to block blockname = RptgenSL.getReportedBlock; blockHandle = get_param(blockname,'handle');
Enter the following if you want to obtain a handle to the model in whose context a Model Loop is executing:
%Access to model modelname = RptgenSL.getReportedModel; modelHandle = get_param(Modelname,'handle');
Enter the following if you want to obtain a handle to the signal in whose context a Signal Loop is executing:
%Access to signal signalname = RptgenSL.getReportedSignal; signalHandle = get_param(signalname,'handle');
Enter the following if you want to obtain a handle to the system in whose context a System Loop is executing:
%Access to system systemname = RptgenSL.getReportedSystem; systemHandle = get_param(systemname,'handle');
Similarly, you can use set calls in place of get calls in the previous examples to set your current block, model, signal, or system within the context of a loop component.
Evaluate this expression if there is an error: Evaluates another MATLAB expression if the specified expression produces an error. You must enter in this field the expression to evaluate in case of an error.
If you do not change the default error handling code, then when you generate the report, and there is an error in the MATLAB code that you added:
If you clear Evaluate this expression if there is an error check box, then the complete report is generated, without displaying an error message at the MATLAB command line.
If you select Evaluate this expression if there is an error check box, then the complete report is generated and an error message appears at the MATLAB command line.
To stop report generation when an error occurs in the MATLAB code that you added, change the second and third lines of the following default error handling code, as described below:
warningMessageLevel = 2; displayWarningMessage = true; failGenerationWithException = false; failGenerationWithoutException = false;
To stop report generation and display an exception, change the default code to:
displayWarningMessage = false; failGenerationWithException = true;
To stop report generation without displaying an exception, change the default code to:
displayWarningMessage = false; failGenerationWithoutException = true;
If you want to completely replace the default error handling code, use the evalException.message variable in your code to return information for the exception.
Inserts text only if you select one of the following options:
Insert MATLAB expression string in report
Display command window output in report
rptgen.cml_eval
Insert Variable, MATLAB Property Table, MATLAB/Toolbox Version Number, Variable Table

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |