upgradeadvisor
Open Upgrade Advisor
Syntax
upgradeadvisor('modelname')
upgrader = upgradeadvisor('modelname')
Description
upgradeadvisor('modelname')
opens the Upgrade Advisor for the model specified bymodelname
. 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 methodsanalyze
andupgrade
with theupgrader
object output of theupgradeadvisor
function.
To programmatically analyze a model for recommended upgrades, create an
upgrader
object and use the methodanalyze
.To programmatically analyze and upgrade a model, create an
upgrader
object and use the methodupgrade
.To configure options before running analyze or upgrade, seeExamples.
Tip
For an example showing how to programmatically upgrade a whole project, seeUpgrade Simulink Models Using a Project.
Input Arguments
|
Name or handle to the model, specified as a character vector. |
Output Arguments
|
Object for analyzing and upgrading the hierarchy of models programmatically. |
Examples
Open Upgrade Advisor on a Model
To open the Upgrade Advisor on thevdp
example model:
upgradeadvisor('vdp')
To open the Upgrade Advisor on the currently selected model:
upgradeadvisor(bdroot)
Programmatically Analyze and Upgrade a Model
Get an
upgrader
object. This example uses a writable copy of thevdp
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: 'myvdp' ReportFile: ''
To analyze the model for recommended upgrades, following library links and model references, run:
analyze(upgrader);
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.
To find the location of the report:
reportLocation = upgrader.ReportFile
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 selectingSend Check ID to Workspace. Then set the
upgrader.ChecksToSkip
property. For example:upgrader.ChecksToSkip = {'mathworks.design.CSStoVSSConvert'}; upgrade(upgrader);
Specify running the Upgrade Advisor on only the current model without following library links or model references, or analyzing test harnesses that are saved as external models:
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
版本
and the existence of aContents.m
file.To turn off showing the report after analyze or upgrade, set:
upgrader.ShowReport = false; % default true
Tip
For an example showing how to programmatically upgrade a whole project, seeUpgrade Simulink Models Using a Project.
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.
Alternatives
You can also open the Upgrade Advisor from the Simulink Editor. In theModelingtab, selectModel Advisor>Upgrade Advisor.
Alternatively, you can open the Upgrade Advisor from the Model Advisor. In the Model Advisor, underBy Task
checks, expand the folderUpgrading to the Current Simulink Version
and select the checkOpen the Upgrade Advisor
.