Documentation

upgradeadvisor

Open Upgrade Advisor

Syntax

upgradeadvisor('modelname')
upgrader = upgradeadvisor('modelname')

Description

upgradeadvisor('modelname') opens the Upgrade Advisor for the model specified by modelname. This command loads the model if necessary, but does not open it in the Simulink® Editor. Use the Upgrade Advisor to help you upgrade and improve models with the current release.

upgrader = upgradeadvisor('modelname') returns an object that you can use to analyze and upgrade a hierarchy of models programmatically. If you specify an output, then the Upgrade Advisor does not open. You can use the methods analyze and upgrade with the upgrader object output of the upgradeadvisor function.

  • To programmatically analyze a model for recommended upgrades, create an upgrader object and use the method analyze.

  • To programmatically analyze and upgrade a model, create an upgrader object and use the method upgrade.

  • To configure options before running analyze or upgrade, see Examples.

Input Arguments

modelname

Name or handle to the model, specified as a character vector.

Output Arguments

upgrader

Object for analyzing and upgrading the hierarchy of models programmatically.

Examples

Open Upgrade Advisor on a Model

To open the Upgrade Advisor on the vdp example model:

upgradeadvisor('vdp')

To open the Upgrade Advisor on the currently selected model:

upgradeadvisor(bdroot)

Programmatically Analyze and Upgrade a Model

  1. Get an upgrader object. This example uses a writable copy of the vdp model.

    load_system('vdp'); save_system('vdp',fullfile(tempdir, 'myvdp'))
    upgrader = upgradeadvisor('myvdp')
    
    upgrader = 
    
      Upgrader with properties:
    
         ChecksToSkip: {}
        SkipLibraries: 0
        SkipBlocksets: 1
         OneLevelOnly: 0
           ShowReport: 1
            RootModel: 'vdp'
           ReportFile: ''
    

  2. To analyze the model for recommended upgrades, following library links and model references, run:

    analyze(upgrader);
    You see a report of issues found.

  3. To analyze the model and automatically fix all issues (where automated fixes are available), run:

    upgrade(upgrader);

    This command follows library links and model references, and saves any fixes to the model files.

    You see a report of issues found and actions taken.

  4. To find the location of the report:

    reportLocation = analyze.ReportFile

  5. You can configure options before running analyze or upgrade.

    • Specify checks to skip before running analyze or upgrade. Find the ID for a check in the Upgrade Advisor by right-clicking the check and selecting Send Check ID to Workspace. Then set the advisor.ChecksToSkip property. For example:

      advisor.ChecksToSkip = {'mathworks.design.CSStoVSSConvert'};
      upgrade(upgrader); 

    • Specify running the Upgrade Advisor on only the current model without following library links or model references:

      upgrader.OneLevelOnly = true; % default false

    • Specify running the Upgrade Advisor on the current model, following model references but not library links:

      upgrader.SkipLibraries = true; % default false

    • Specify running the Upgrade Advisor on the current model, including upgrading files in blocksets or toolboxes:

      upgrader.SkipBlocksets = false; % default true
      By default, the Upgrade Advisor does not upgrade files in blocksets or toolboxes. The Upgrade Advisor detects blocksets from the output of ver and the existence of a Contents.m file.

    • To turn off showing the report after analyze or upgrade, set:

      upgrader.ShowReport = false; % default true

Related Examples

Alternatives

You can also open the Upgrade Advisor from the Simulink Editor, by selecting Analysis > Model Advisor > Upgrade Advisor.

Alternatively, you can open the Upgrade Advisor from the Model Advisor. In the Model Advisor, under By Task checks, expand the folder Upgrading to the Current Simulink Version and select the check Open the Upgrade Advisor.

More About

collapse all

Tips

  • The Upgrade Advisor can identify cases where you can benefit by changing your model to use new features and settings in Simulink. The Advisor provides advice for transitioning to new technologies, and upgrading a model hierarchy.

    The Upgrade Advisor can also identify cases where a model will not work because changes and improvements in Simulink require changes to a model.

    The Upgrade Advisor offers options to perform recommended actions automatically or instructions for manual fixes.

See Also

Introduced in R2012b

Was this topic helpful?