Main Content

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 projectThe 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 .p file, you can regenerate it automatically by running the project checks. In MATLAB, on the Project tab, click the down arrow to expand the Tools gallery. Under Project Checks, click Check Project.

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 .slx extension but is not a valid Simulink model. The Dependency Analyzer warns and does not analyze the file.

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 .m file that contains a syntax error. The Dependency Analyzer warns and does not analyze the file.

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.

  • Blocks are labeled with missing products (for example, SimEvents not installed)

  • Tooltips include the name of the missing product

  • Messages provide links to open Add-On Explorer and install the missing products

To find a link to open Add-On Explorer and install the product:

  • For built-in blocks, open the Diagnostic Viewer, and click the link in the warning.

  • For unresolved library links, double-click the block to view details and click the link.

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.

Circular dependency on ProjectName

The project hierarchy contains a circular dependency.

Break the circular dependency. For example, if the reference to ProjectName is not needed, remove ProjectName from the list of the top-level project references.

If the reference to ProjectName is needed, refactor your project hierarchy to eliminate the circular dependency.

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 panel on the right, in the Problems section, click the magnifying glass. The dependency graph displays a node highlighted in bright yellow. The node also displays a warning sign.

  1. 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.

  2. 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.

    In the graph, right-click the node that displays a warning. Select Hide Warnings.

  3. 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.

  1. In the Dependency Analyzer toolstrip, click File List.

  2. 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.

  3. 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.

Related Topics