What is different between 'Simulink.​ModelAdvis​or.getMode​lAdvisor' and 'ModelAdvsior.run'?

3 次查看(过去 30 天)
Q1.
I'm using trial version of MATLAB and i try to use model advisor recently. There are two ways to analysis model using Model Advisor.
One way is analysis model by Model Advisor GUI, the other one is using matlab command line like Simulink.ModelAdvisor.getModelAdvisor('sldemo_mdladv')
But, each way's result are different each other. After that, I found another matlab command 'ModelAdvisor.run' that can't run because don't have a Simulink checks license while I try to search why they are different.
I want to know what is different between ModelAdvisor.run and Simulink.ModelAdvisor.
Q2.
Why i can't print same result with Model Advisor GUI's result by Model Advior's command line?
In Model Advisor GUI, I check all checkbox in By Product, By Task. In MATLAB command line, I run script:
load_system('sldemo_mdladv');
handler = Simulink.ModelAdvisor.getModelAdvisor('sldemo_mdladv');
handler.selectCheckAll;
handler.runCheck
The report don't contain all of check. Report contain just 20~30 checks. Even, some checks don't run any error:
Too many input arguments.
This type of variable does not support point indexing.
This type of variable does not support point indexing.
But, In report made by Model Advisor GUI, there are not fail. Why these are different?

回答(1 个)

arushi
arushi 2024-8-22,8:31
Hi Donghun,
When using MATLAB's Model Advisor, it's important to understand the differences between the various methods of running checks and why results might differ between the GUI and command-line approaches. Let's address your questions:
Difference Between ModelAdvisor.run and Simulink.ModelAdvisor
  1. Simulink.ModelAdvisor:
  • This is an object-oriented interface that allows you to interact with the Model Advisor programmatically. You can select checks, run them, and generate reports using this interface.
  • It's useful for scripting and automation of the Model Advisor checks within MATLAB.
2. ModelAdvisor.run:
  • This function is a higher-level command that might require a specific license for Simulink Check, which is an additional product that extends Model Advisor capabilities.
  • It provides a more streamlined way to run checks but is dependent on having the appropriate licenses.
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Run Model Advisor Checks 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by