Explore an Example Project
This example opens the Times Table App example project to explore how project tools can help you organize your work.
Open the example to download the Times Table App example project and explore how to
Browse some example project files under source control.
Examine project shortcuts to access frequently used files and tasks.
Analyze dependencies in the project and locate required files that are not yet in the project.
Modify some project files, find and review modified files, compare them to an earlier version, and commit modified files to source control.
Explore views of project files only, modified files, and all files under the project root folder.
View, Search, and Sort Project Files
The Project panel shows all files under the project root folder. By default, the panel has a project Status column and a Labels column. If the project is under source control, a source control column displays the source control status of the files in the project root folder.
To view only the files that have the status In project, right-click the white space and select Filter > Show Only Project Files.
To find files and folders in the open project, use the Find Files panel
.
For more information, see Manage Project Files.
Open and Run Frequently Used Files
You can use shortcuts to make files easier to find in a large project. View and run shortcuts from the Shortcuts gallery in the Project toolstrip. You can organize the shortcuts into groups.
The Times Table App project contains several shortcuts, including a shortcut to open the project requirements, and another to run all the tests in the project. The shortcuts make these tasks easier to find for users of the project.
To perform an action associated with a shortcut, in the Shortcuts gallery, click the associated shortcut. For example, to open project requirements, click Requirements. To run tests, click Run All Tests.
To create a new shortcut, in the Project panel, right-click a file, and select Create Shortcut.
For more information, see Create Shortcuts to Frequent Tasks.
Add Folder to Project
To add a folder and its content to the project, in the Project panel, right-click in white space and then select New > Folder. You can also paste or drag an existing folder into the Project panel. The folder and its content are automatically added to the project.
To ensure files are accessible when running tasks in the project, add the project folder to the project path. In the Project panel, right-click the folder and select Add to Project Path > Selected Folder and Subfolders.
Review Changes in Modified Files
Open files, make changes, and review the changes.
In the Project panel, in the
source
folder, open thetimesTableGame.m
file by double-clicking itMake a change in the Editor, such as adding a comment, and save the file. In the project panel, you can identify modified files using the blue Modified icon
in the source control column. For large projects, use the Source Control panel
to see the modified files. If the Source Control icon is not in the sidebar, click the Open more panels button
and select the Source Control panel.
To review changes, right-click
source/timesTableGame.m
and select Source Control >View Changes. The MATLAB Comparison Tool opens a report comparing the modified version of the file in your working copy to its ancestor stored in version control. The comparison report type can differ depending on the file you select. If you select a Simulink® model to compare, a Simulink model comparison report opens.
Analyze Dependencies
To check that all required files are in the project, run a file dependency analysis on your project.
In the Project toolstrip, in the Tools gallery, click Dependency Analyzer.
The dependency graph displays the structure of all analyzed dependencies in the project. The right pane lists required add-ons and any problem files. Observe that there are no problem files listed.
Now, remove one of the required files. In the Project panel, right click the source/timesTableGame.m
file, and select Remove from Project. Click Remove in the Remove from Project dialog box.
The Dependency Analyzer automatically updates the graph and the Problems section in the Properties pane.
Check again for problems.
In the Dependency Analyzer, in the Properties pane, point to the problem message, File not in project, under Problems and click the magnifying glass
. The graph updates to highlight the problem file,
timesTableGame.m
.To view the dependencies of the problem file, in the Impact Analysis section, click All Dependencies.
Now that you have seen the problem, fix it by returning the missing file to the project. Right-click the file and select Add to Project. The next time you run a dependency analysis, the file does not appear as a problem file.
After running a dependency analysis, to investigate the dependencies of modified files, perform an impact analysis.
In the Views section, click Source Control. The graph colors the files by source control status.
Select the modified files in the graph or in the File List.
To view the dependencies of the modified files, in the Impact Analysis section, click All Dependencies.
For more information, see Analyze Project Dependencies.
Run Project Integrity Checks
To make sure that your changes are ready to commit, check your project. To run the project integrity checks, in the Project toolstrip, in the Environment section, click Project Issues. In the Project Issues panel, in the Checks tab, click Run Checks. The checks look for missing files, files to add to source control or retrieve from source control, and other issues. The Issues panel only lists the checks that fail and automatic fixes when possible. For more information, see Run Project Checks.
Commit Modified Files
After you modify files and you are satisfied with the results of the checks, you can commit your changes.
In the Project toolstrip, in the Source Control section, click Commit. You can also click Commit in the Source Control panel.
Enter a comment for your submission, and click Commit. The status icons in the source control column changes from blue to green. In Git, you can have both local and remote repositories. These instructions commit to the local repository. To commit to the remote repository, in the Source Control section, click Push.
For more information about using source control in MATLAB, see Source Control.
View Project and Source Control Information
To view and edit project details, in the Project toolstrip, click Settings. Then, view and edit project details such as the name, description, project root, startup folder, and location of folders containing generated files.
To view details about the source control integration and repository location, in the Project panel, right-click the white space and select Source Control > View Details.
Close Project
To close the project, In the Project toolstrip, click Close Project. Alternatively, use the close
function.