Create a Batch Function

In Simulink® Project, in the Batch Job view, you can create functions and run them on selected project files.

For example batch jobs, see Running Batch Jobs with a Simulink Project.

To create a batch function that is also a shortcut, so it is easy to reuse:

  1. In the Simulink Project, click the Shortcut Management node.

  2. Select Create Action Shortcut > Batch Job Function.

  3. Name and save the file on your MATLAB® path.

  4. Edit the function to perform the desired action on each file. The file contains a simple example batch job for you to edit. The instructions guide you to create a batch job with the correct function signature.

  5. In the Batch Job view, you can select the shortcut in the Batch Job list without browsing for the file.

To create a batch function that is not a shortcut:

  1. In the Batch Job view, click Create.

    The MATLAB Editor opens a new untitled file containing a simple example batch job. The instructions guide you to create a batch job with the correct function signature.

  2. Edit the function to perform the desired action on each file.

  3. Save the function file on your MATLAB path.

To make existing batch functions into shortcuts, see Create Shortcuts to Batch Job Functions.

Related Examples

Was this topic helpful?