Run a Project Custom Task and Publish Report
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.
Tip
If the function can identify the files to operate on, include all files. For example, the custom task function
saveModelFiles
in theairframe
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.
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.
Click Run Task.
The project displays the results.
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:
Open an example project by entering
openExample('simulink/AirframeProjectExample')
.On the Project tab, click the down arrow to expand the Tools gallery. Under Project Checks, click Custom Tasks.
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.
Click Run Task. Results appear.
Click Publish Report.
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.
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
.To see the report file and add it to your project, switch to the All files view.
Tip
To try example custom tasks in a project, see the example Run Custom Tasks with a Project.