- open_system(modelName); - to load a Data Inspector
- sim(modelName); - to register data in DI
- runIDs = Simulink.sdi.getAllRunIDs; - to get the IDs of all runs you made. If DI was clear at line 2. It should be scalar
- logsout = Simulink.sdi.exportRun(runID(end)); - this will get you logs
- close_system(modelName,0); - close opened model discarding changes (0 value)
simulation exits with error --> get simulation results
6 ビュー (過去 30 日間)
古いコメントを表示
Hi, I am using a simulation that is started from matlab with the sim() command and is stopped by an assertion within the model.
Is there a way to get the simulation results (logged signals, to workspace signals, ...)?
Cheers, Frank.
0 件のコメント
回答 (1 件)
Piotr Kluczek
2021 年 4 月 7 日
Hi Frank,
You probably dont need that help now, but I found a workaround (not really clean, but works):
This is script equivalent to opening a model, clicking run and saving only logsout = out.logsout. And closing discarding any changes. So you won't have metadata and other info from SimulationOutput structure.
I hope someone will find it usefull.
Regards, Piotr
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!