how to automatically get the results from Model Advisor's report

2 次查看(过去 30 天)
Hello everyone
I need to perform some tests on severals blocks, my advisor of my intership advised me to use Model Advisor
I found a way to automaticaly run the M.A to perform the tests but I cannot find a way to get the results of all tests.
I'm capable to read only one test at time by getCheckResult(id), but I'm looking for a command to get an overall result like "1 test failed on 24"
hereafter you can find the code that I use to launch the Model Advisor
MdlAdvHandle = Simulink.ModelAdvisor.getModelAdvisor(ModelName,'new');
MdlAdvHandle.selectCheckAll;
MdlAdvHandle.runCheck;
%Affichage du rapport de Model Advisor
MdlAdvHandle.displayReport;
result = MdlAdvHandle.getCheckResult('Check solver for code generation');
Do you know if there is way to automatically get the results of all tests carried out by M.A ?
thanks for reading

采纳的回答

grapevine
grapevine 2012-7-24
编辑:grapevine 2012-7-24
I wrote something, in a way it works
allIDs = ma.getCheckAll;
res=ma.getCheckResult(allIDs);
nTest=length(res);
TestPassed=0;
NumTestPassed=0;
WarningOrError=0;
for index=1:1:nTest
if index==12|| index==15 || index==16 || index==20
end
resTmp=res(index);
if iscell(resTmp)
resBTmp=resTmp{1,1};
if (length(resBTmp)==2)
stringres=char(resBTmp{1,1});
else
stringres=resBTmp;
end
if(~isempty(regexp(stringres,'Passed')))
TestPassed=1;
NumTestPassed=NumTestPassed+1;
else
WarningOrError=WarningOrError+1;
end
else
TestPassed=0;
end
end

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by