Main Content

Run a Project Custom Task and Publish Report

  1. On the Project tab, click the down arrow to expand the Tools gallery. Under Project Checks, click Custom Tasks, and then select the check boxes of project files you want to include in the custom task.


    If the function can identify the files to operate on, include all files. For example, the custom task 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 custom task function to run in the Custom task box. Enter the name, or click Browse, or choose from a list of custom tasks.

    If your project does not yet contain any custom task functions, see Create a Custom Task Function.

  3. Click Run Task.

    The project displays the results.

  4. To view details of results for the currently selected file, click a file and check the Results pane.

You can publish a report of your custom task results. For example, try this custom task:

  1. Open an example project by entering openExample('simulink/AirframeProjectExample').

  2. On the Project tab, click the down arrow to expand the Tools gallery. Under Project Checks, click Custom Tasks.

  3. In the Custom Task dialog box, click the Custom task drop-down arrow to choose from a list of tasks, and select Generate Bill of Materials Report.

  4. Click Run Task. Results appear.

  5. Click Publish Report.

  6. 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™, you can also choose PDF.

  7. View the results in the report.

    The example custom task 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 custom task in the file billOfMaterials.m.

  8. To see the report file and add it to your project, switch to the All files view.


To try example custom tasks in a project, see the example Run Custom Tasks with a Project.

Related Topics