I am tring to continue matlab script execution after polyspacecodeprover function showing error in matlab window. but matlab close script execution .
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to continue matlab script execution after polyspacecodeprover function fail for that I tried with try-catch condition, but when polyspace function fails, directly script execution will stop.
can any commands available in polyspacecodeprover function for return in matlab?
mycode ->
function return = polyspace()
try
polyspaceCodeProver('-sources',sourceFileName,...
'-I',includeFileName, ...
'-results-dir',resFolder2,...
'-misra3','mandatory',...
'-do-not-generate-results-for','all-headers',...
'-main-generator');
return = 1
catch
return = 0
end
end
댓글 수: 0
채택된 답변
Anirban
2020년 12월 8일
편집: Anirban
2020년 12월 8일
Hi,
I am guessing when you mention failure of the polyspace function, you mean a failure because of compilation errors in the source code or some such thing. In those cases, a better approach would be to poll the return value of the polyspaceCodeProver function, like so:
status = polyspaceCodeProver('-sources',sourceFileName,...
'-I',includeFileName, ...
'-results-dir',resFolder2,...
'-misra3','mandatory',...
'-do-not-generate-results-for','all-headers',...
'-main-generator');
If the verification fails, the function returns 1 to the status variable, otherwise 0.
A similar approach is given for the polyspace.Project object in Troubleshoot Polyspace Analysis from MATLAB. This object provides a cleaner way to run Polyspace from MATLAB. So, you can also use this object instead of the polyspaceCodeProver function.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Troubleshoot Compilation Errors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!