Documentation

Run a Simulink Project Batch Job and Publish Report

  1. In Simulink® Project, in the Batch Job view, select the check boxes of project files you want to include in the batch job.

      Tip   If the batch function can identify the files to operate on, include all files. For example, the batch job function saveModelFiles in the airframe project checks that the file is a Simulink model and does nothing if it is not.

    To select multiple files, Shift or Ctrl+click, and then right-click a file and select Include or Exclude.

  2. Specify the batch function to run in the Batch function box. Enter the name, or click Select to browse or choose from a list of Batch Job shortcuts and recently used shortcuts.

    If your project does not yet contain any batch functions, see Create a Batch Function.

  3. Click Run Batch Job.

    Simulink Project displays the results in the Batch Job Results column.

  4. Expand the Results pane to view details of results for the currently selected file.

You can publish a report of your batch job results. For example, try this batch job:

  1. Open an example project by entering sldemo_slproject_batchjobs.

  2. In the Batch Job view, click Select to choose from a list of batch job shortcuts and recently used shortcuts. Choose Select > Utility > Generate Bill of Materials Report.

  3. Click Run Batch Job. Results appear.

  4. Click Publish Report.

  5. In the file browser, specify a name and location for the report, and choose a file type from HTML or Microsoft® Word. If you have MATLAB® Report Generator™, on Windows®, you can also choose PDF.

  6. View the results in the report.

    The example batch job function Generate Bill of Materials Report creates a list of project files, their source control status, revision numbers, and MD5 checksums. You can view the code for this batch job in the file billOfMaterials.m.

  7. To see the report file and add it to your project, switch to the All Files View.

Related Examples

Was this topic helpful?