Video length is 3:18

How to Generate a Fault Specification Report in MATLAB

After you create faults in your model, you might want a summary of your faults in a clean, easy-to-read format such as a PDF that you can share outside of MATLAB®. Learn how to do that with Simulink Fault Analyzer™ by generating a fault specification report.

Published: 19 Jun 2024

Hi everyone, I’m Scott, A documentation writer at MathWorks.

After you create faults in your model, behaviors and all, you might want a summary of your faults in a clean, easy-to-read format that you can share outside of MATLAB and Simulink. Something like a PDF, perhaps? You can do that with Simulink Fault Analyzer by creating a fault specification report. I’ll show you how to do that here.

First, let’s get an example model that has some faults. Open the sldemo_fuelsys_fault_analyzer and set up the faults by entering these commands.

The model has three faults. We can confirm that by opening the fault table. In the Fault Analyzer tab, in the view section, click Fault Table.

Now we can share our fault specifications in a report. In the Fault Analyzer tab, in the Review Results section, click Report Generator.  The Create a Fault Specification Report window opens.

In the window, you can specify what kind of information that you want to include about the faults. For example, maybe you want to include a copy of the fault table. Keep that selected. Or maybe you want to omit the fault details. You can include as much or as little information as you want.

You can also specify a Title, an Author, a file format, a file name, and where it’s stored (box each option). The default format is PDF, but you could select a Microsoft Word document or HTMX formats (expand the list to show).

Let’s include all of the available information for now and generate the report, but include a custom title and author. I’ll just call this report My report, and the Author is just my first name. Click OK. The Simulink Fault Analyzer software saves the report in the working folder, and opens it automatically.  (waiting time speed up)

Let’s check out what we’ve got (scroll through). Ok, we’ve got a title page with our custom title and author name, a table of contents, some faults and their behaviors. Cool! All conveniently saved in a PDF document.

Note though, that this is a separate file from the model. If you make any additional changes to the model and the faults, you’ll need to regenerate the report.

For more information on generating reports, and the information you can include, check out the Generate Fault Specification Reports topic, in the Simulink fault analyzer, documentation.

If you need to automate the report generation a little, you can generate this report programmatically in MATLAB as well. To do that, use the Simulink.fault.report function. You can specify the same options that you did interactively as name-value arguments. Most of them are true by default, so we don’t have to specify a lot of them for this example. To recreate the report by using the function, enter this command into MATLAB.

And there it is, a brand new report with all of the same content as the report we generated earlier. Cool!

For more information on that function, see the Simulink.fault.report function reference page, in the Simulink Fault Analyzer, documentation.