Main Content

Check Dependency Results and Resolve Problems

If you have not yet run an analysis, on the Project tab, in the Tools section, 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 toolbox dependencies and a list of problems for the entire project.

Problem Message

Description

Fix

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.

Unsaved changes

The file has unsaved changes in the Simulink® editor.

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, select Run Checks > Check Project and follow the prompts to rebuild the files.

If you rename a source file, the project detects the impact to the derived file and prompts you to update it.

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.

Investigate Problem Files in Dependency Graph

Use the graph to investigate problem files graphically.

  1. In the Properties pane, in the Problems section, point to a problem, such as 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: 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 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.

  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 Not in project, and click the magnifying glass icon .

    The File List shows only files with the specific problem.

    To fix the 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