What are some alternatives to simulink.compiler.getSimulationOutput that may be faster for certain applications?
4 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2024 年 2 月 23 日
回答済み: MathWorks Support Team
2024 年 2 月 23 日
I have a model I am trying to run with Simulink Compiler with live plotting using the postStepFcn. I notice that the pace of my simulation is slow. When using the profiler I see most of the time is spent in simulink.compiler.getSimulationOutput. I notice this function returns all the data for the simulation up to the current point. For a long running simulation this could be a lot of data. Are there any alternatives?
Fetch the partial simulation output during simulation run time - MATLAB simulink.compiler.getSimulationOutput (mathworks.com)
採用された回答
MathWorks Support Team
2024 年 2 月 23 日
First consider using the decimation option of the postStepFcn. This can significantly improve performance.
Next consider turning off all logging and instead using the setExternalOutputFcn to get the output of the simulation. This function will only return the output at the current step which can be much faster.
If you need to save some amount of historical data, consider implementing a circular buffer that is written to in the ExternalOutputFcn. Attached is an example of how to implement a circular buffer. In the example, a figure is used instead of App Designer but the concept translates to App Designer apps.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deploy Standalone Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!