Check Dependency Results and Resolve Problems
If you have not yet run an analysis, on the Project tab, click the down arrow to expand the Tools gallery. Under Apps, click Dependency Analyzer.
When you run a dependency analysis, the Dependency Analyzer identifies problems, such as missing files, files not in the project, unsaved changes, and out-of-date derived files. You can examine problem files using the dependency graph or the file list. When no file is selected, the Properties pane on the right shows the add-ons dependencies and a list of problems for the entire project.
Problem Message | Description | Fix |
---|---|---|
File not in project | The file is not in the project. | Right-click the problem file in the graph and select Add to Project. To remove a file from the problem list without adding it to the project, right-click the file and select Hide Warnings. |
Missing file | The file is in the project but does not exist on disk. | Create the file or recover it using source control. |
The file or variable cannot be found. | If this status is acceptable, right-click the file and select Hide Warnings. Depending on the way you call an object method, the Dependency Analyzer might confuse a method with a function and report a missing dependency. See Analysis Limitations. | |
Outside project root | The file is outside the project root folder. | If this status is acceptable, right-click the file and select Hide Warnings. Otherwise, move it under the project root. If required files are outside your project root, you cannot add these files to your project. This dependency might not indicate a problem if the file is on your path and is a utility or resource that is not part of your project. Use dependency analysis to ensure that you understand the design dependencies. |
In unreferenced project | The file is within a project that is not referenced by the current project. | Add the project containing the file as a project reference. |
Unsaved changes | The file has unsaved changes in the MATLAB® and Simulink® editors. | Save the file. |
Derived file out of date | The derived file is older than the source file it was derived from. | Regenerate the derived file. If it is a If you rename a source file, the project detects the impact to the derived file and prompts you to update it. |
Created in a newer release | The file is created in a newer release than the one currently used. For example, the file is a Simulink model file created in a newer Simulink release. The Dependency Analyzer warns and does not analyze the file. | If this status is acceptable, right-click the file and select Hide Warnings. Otherwise, open the model in the release you used to create it and export to a previous version. See Export Model to Previous Version of Simulink. |
Not a valid file format | The file is not a format supported by MathWorks® products. For example, the file has
| If this status is acceptable, right-click the file and select Hide Warnings. |
File with syntax error | The file contains a syntax error or the Dependency Analyzer
cannot parse the file. For example, the file is an
| If this status is acceptable, right-click the file and select Hide Warnings. Otherwise, fix the syntax error and save the file. |
Product not installed | The project has a dependency on a missing product. | Fix models by installing missing products. If you open a model that contains built-in blocks or library links from missing products, you see labels and links to help you fix the problem.
To find a link to open Add-On Explorer and install the product:
Product dependencies can occur in many other ways, for example in callbacks, so in this case you cannot easily see where the missing product is referenced. Fix models by installing missing products. |
Missing package dependency | The project does not declare a dependency on a required package. | Declare a dependency on the required package. For more
information, see |
Circular dependency on
| The project hierarchy contains a circular dependency. | Break the circular dependency. For example, if the reference to
If the reference to
This warning is specific to the Project Hierarchy view and is available only in MATLAB Online™. |
Investigate Problem Files in Dependency Graph
Use the graph to investigate problem files graphically.
In the Properties pane, in the Problems section, point to a problem, such as
File not in project
, and click the magnifying glass icon . The graph highlights the files with this specific problem.To go through these files, use the arrows in the search box (e.g., Problem:
File not in project
).To undo the highlighting, close the search box.
To see more information about a specific problem file, select the file in the graph. In the Properties pane, in the Problems section, you can see details including the path, type, and the problems for this file.
Take actions to resolve the problem file. For example, if a file is
File not in project
, right-click the problem file in the graph and select Add to Project. To remove the file from the problem list without adding it to the project, right-click the file and select Hide Warnings.Investigate the next problem listed in the Problems section. Repeat the steps until you resolve all problems.
To update the graph and the Problems list, click Analyze.
Tip
For large projects, viewing the results in a list can make navigation easier.
For more ways to work with the dependency graph, see Perform an Impact Analysis.
Investigate Problem Files in File List
For large projects, use the File List to investigate your project problem files.
In the Dependency Analyzer toolstrip, click File List.
In the Properties pane, in the Problems section, point to a problem, such as
File not in project
, and click the magnifying glass icon .The File List shows only files with the specific problem.
To fix the
File not in project
problem, select all the files in the list. Use the context menu and select Add to Project. To remove a file from the problem list without adding it to the project, right-click the file and select Hide Warnings.Investigate the next problem listed in the Problems section, for example
Missing file
. Repeat the steps until you resolve all problems.To update the graph and the Problems list, click Analyze.