Main Content

Upgrade All Project Models, Libraries, and MATLAB Code Files


Before upgrading, if you put your project under source control, you can easily revert changes later if you want. See Add a Project to Source Control.

Upgrade all models, libraries, and MATLAB® code files in your project to the latest release using a simple workflow. The Upgrade Project tool can apply all fixes automatically when possible, upgrade all model hierarchies in the project at once, and produce a report. You do not need to open the Upgrade Advisor.

  1. On the Project tab, click the down arrow to expand the Tools gallery. Under Project Checks, click Upgrade Project.

  2. In the Upgrade Project dialog box, to upgrade all files, run all checks, and apply fixes automatically where possible, click Upgrade. If you want to change the settings, use these options before clicking Upgrade:

    • If you want to run upgrade checks but not apply fixes automatically where possible, clear the check box Apply upgrades automatically.

    • If you want to change which files to upgrade and which checks to run, click Change Options. In the Upgrade Options dialog box, clear check boxes for models and checks you want to exclude from the upgrade. For example, you might want to exclude checks that require an Update Diagram.

    When you click Upgrade, the tool runs the checks and applies fixes if specified. Upgrading can take several minutes.

  3. Examine the Upgrade Project Report. The summary at the top shows how many files passed and how many files require attention.

    1. Select files in the left list to view check results on the right. By default, the left list shows any files that need attention. Show instead all files, files types, all results, files that passed, or files that passed with fixes, by using the Show controls.

    2. Select checks in the right list to read details of results and any applied fixes in the lower pane. Examine checks marked as needing attention, with an orange circle in the Result column. For details of upgrading libraries, see Upgrade Libraries.

    3. If your project is under source control, you can examine the upgrade changes in your files using a comparison report. To see the differences before and after upgrade, in the Upgrade Project Report, click View Changes.

  4. The project saves an HTML report of the upgrade results in the project root folder. To open the published report, click the Report link at the top of the Upgrade Project Report.

  5. To close the interactive report, click Close.

Upgrade Libraries

The project automatically runs all upgrade checks on multiple libraries, including any checks that require an Update Diagram.

You cannot run Update Diagram on a library, so project upgrade runs the Update Diagram checks in the models where the library blocks are used. This means that project upgrade can only fully upgrade library blocks that are used in a model. If the library block is used in a model, project upgrade automatically runs all checks, including Update Diagram checks, and then upgrades the block in the library.

If a library block is not used in any project model, then the check Run checks that require Update Diagram on library blocks is marked as needing attention, with an orange circle in the Result column. Select the check and in the details pane you see the message Unable to upgrade blocks unused by a model.

  • To upgrade unused library blocks, use the blocks in a model and then upgrade.

  • If you want to upgrade library blocks that use forwarding tables, disable the library link and save the model before upgrading, upgrade and then restore the link.

The upgrade of library blocks depends on the model context. The same library block might be used in multiple models. Linked library blocks inherit attributes from the surrounding models, such as data types and sample rate. The blocks' behavior can differ depending on the context where they are used, and this can lead to conflicting upgrades for Update Diagram checks. If models require a different upgrade of the same library block, you are prompted to view and resolve the upgrade conflict.

If you need to review conflicting upgrades, click Merge. Alternatively you can review conflicting upgrades later from the report. Review changes in the comparison report and choose which upgrades to save.

See Also

Related Topics