| Contents | Index |
You can add MATLAB code to a report, by using the Evaluate MATLAB Expression component (also called the Eval component).
The Evaluate MATLAB Expression component dialog box includes an Evaluate this expression if there is an error check box. The dialog box includes default error handling code that you can use, or you can create your own error handling code.
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.
![]() | Adding Components to the Report Template | Generating the Report | ![]() |

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 |