Manage Project Files - MATLAB & Simulink (original) (raw)
This table shows how to add, move, rename, and open project files and folders. Some of these actions can also lead to automatic updates that affect other files. All can be undone and redone.
Action | Procedure |
---|---|
View project files. | In the Files view, clickProject to display only the files and folders that are included in the project. |
View all files in a project folder. | To display all files and folders in the project folder, in theFiles view, clickAll.You might not want to include all files in your project. For example, you might want to exclude SVN or CVS source control folders. For more information, seeWork with Derived Files in Projects. |
Create a new project folder. | In the Files view, right-click in white space, and then click New > Folder. |
Add files to a project. | On the Project tab, click the down arrow to expand the Tools gallery. UnderProject Files, click Add Files. Select from the list of unmanaged files in the project folder.You also can paste or drag files and folders from your operating system file browser or the Current Folder browser to the project Files view. When you drag a file to the Files view, MATLABĀ® adds the file to the project.To add a file programmatically, use the addFile and addFolderIncludingChildFiles functions. For example, to add a file named myfile.m to theproj project object, typeaddFile(proj,'myfile.m');. |
Remove project files or folders. | In the Files view, right-click the file, and then select .To remove a file programmatically, use the removeFile function. |
Move project files or folders. | Cut and paste or drag the files in the project. |
Rename project files or folders. | In the Files view, right-click the file, and then click Rename. |
Open project files. | In the Files view, right-click the file, and then click .You also can double-click the file. |
Preview project file contents without opening the file. | In the Files view, select the file. The panel in the bottom right of the Files view displays the file information and labels. To restore the panel if it is minimized, click the Restore ![]() |
Delete a project file or folder. | In the Files view, right-click the file, and then click . |
Undo or redo an action | Click ![]() ![]() |
Automatic Updates When Renaming, Deleting, or Removing Files
When you rename, delete, or remove files or folders in a project, the project runs a dependency analysis to check for effects on other project files. When the analysis is complete, the project displays the affected files. If you have not yet run a dependency analysis on the project, the analysis may take some time to run. Subsequent analyses are incremental updates, and so they run faster.
When renaming files, the project offers to automatically update references to the file. Automatically updating references to a file when renaming prevents errors that result from changing names or paths manually and overlooking or mistyping the name.
For example:
- When renaming a class, the project offers to automatically update all classes that inherit from it.
- When renaming a
.m
or.mlx
file, the project offers to automatically update files and callbacks that call it. The project does not automatically update.mlx
files. You need to update them manually. - When renaming a C file, the project prompts you to update the S-function that uses it.
You can disable the automatic updates when renaming, deleting, or removing files in a project. On the MATLABHome tab, in the Environment section, click Preferences. Select MATLAB > and clear the Detect project-wide references when renaming, removing, and deleting files option.
For more information about automatic updates when renaming, deleting, or removing SimulinkĀ® files such as library links, model references, and model callbacks, see Automatic Updates When Renaming, Deleting, or Removing Files (Simulink).