Documentation

Automate Startup Tasks

In Simulink®Project, startup files help you set up the environment for your project.

Startup files are automatically run (.mand每分钟files), loaded (.matfiles), and opened (Simulink models) when you open the project.

Note

Startup scripts can have any name. You do not need to usestartup.m

You can use a file namedstartup.mon the MATLAB®path which runs when you start MATLAB. If yourstartup.mfile calls the project withsimulinkproject, an error appears because no project is loaded yet. To avoid the error, renamestartup.mand use it as a project startup file instead.

Configure an existing file to run when you open your project.

  • Right-click the file and selectRun at Startup.

  • Alternatively, on the Simulink Project tab, clickStartup Shutdown. In the Manage Project Startup and Shutdown dialog box, you can add and remove startup and shutdown files. If execution order is important, change the order using the arrow buttons.

In the files view, theStatuscolumn displays an icon and tooltip indicating the file will run at startup.

Note

Startup file settings are included when you commit modified files to source control. Any startup tasks you create run for all other project users.

To stop a file running at startup, change back by right-clicking it and selectingRemove from Startup.

When you open the project, the startup files run. Also, the current working folder changes to the project startup folder. If you want to set the startup folder, on the Simulink Project tab, clickDetailsand edit theStart Upfolder. SeeSpecify Project Details, Startup Folder, and Derived Files Folders.

You can create new startup and shutdown files interactively in the Simulink Project or at the command line. For details, seeaddStartupFile.

Related Examples

More About

Was this topic helpful?