how to clear the diagnostic viewer on call of sim(..)

조회 수: 6 (최근 30일)
Stefan Monstein
Stefan Monstein 2024년 12월 6일
댓글: Stefan Monstein 2024년 12월 6일
error messages in the diagnostic viewer never disappear, except if you click on report->'clear all'. Thats annoying, because you never know which errors are new and which you have solved already.
I assumed there must be some way via sldiagviewer.xxx but can't find a solution
disp('start sim');
% <- clear the diagnostic viewer
out = sim(modelname);
disp('model simulated');

채택된 답변

Githin George
Githin George 2024년 12월 6일
편집: Githin George 2024년 12월 6일
Hi Stefan,
I did come across a way to distinguish diagnositc viewer messages for subsequent simulation runs.
You will need to use the function "sldiagviewer.createStage" to create something called a "stage" object. Think of it as essentially creating new panes for your Diagnostic Viewer.
disp('start sim');
% create a new stage object
% [A new Diagnostic Viewer Pane with its Unique ID
% - You will need to come up with a uniqueID by yourself.
% I used "Analysis"+runID to make it unique for example]
myStage = sldiagviewer.createStage('<UniqueName>',"ModelName",gcs);
try
sim('fcn');
end
% deleting the handle is Very IMPORTANT - Otherwise your new stage object
% will be generated as a sub panel inside the current pane
delete(myStage);
Refer to the documentation for more information: [Take note of the 4 points in the description]
As you can see in the image, "Analysis2" and "Analysis1" are 2 separate stages (Panes) for my 2 simulation runs.
  댓글 수: 1
Stefan Monstein
Stefan Monstein 2024년 12월 6일
thanks, that is probably good enough for now. However, it poses the question how you can remove the old stages once you running into hundreds of them.
the documentation (point 3) tells about parent and chilren of the current/first stage, but you cannot access myStage.Parent to delete the other children.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by