Filter löschen
Filter löschen

How to run ModelAdvisor by command line???

11 Ansichten (letzte 30 Tage)
galaxy
galaxy am 25 Mär. 2020
Beantwortet: Pramil am 13 Sep. 2024 um 10:55
Dear all,
I want to run ModelAdvisor and put result in current model advisor as following
ma = Simulink.ModelAdvisor.getModelAdvisor(system); % system is model name
success = runCheck(ma,checkID);
if success
success = setCheckResultStatus(ma,getCheckResultStatus(ma,checkID)); %% Here is error: Error using Simulink.ModelAdvisor/setCheckResultStatus
% setCheckResultStatus method can only be called while executing check callback.
end
I also use the ModelAdvisor.run function after runCheck function, SysResultObjArray is not empty, but error same before
success = runCheck(ma,checkID);
SysResultObjArray = ModelAdvisor.run(system, checkID);
...
ma.setCheckResultStatus(true); %% Error same before
If I run ModelAdvisor.run without runCheck function, SysResultObjArray is empty, so can not to get result.
Do anyone can solve it??
Thank you so much

Antworten (1)

Pramil
Pramil am 13 Sep. 2024 um 10:55
Hey Galaxy,
The error you are getting is expected, the “setCheckResultStatus” method can only be used inside of a “check callback” function as the error suggests.
Here is a link to the “setCallbackFcn” function, where the above can be used:
Also, assuming you are trying to create your own custom Model Advisor check, you can refer the following documentation for a detailed example:
Hope it helps.

Kategorien

Mehr zu Model Upgrades finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by