- https://www.mathworks.com/help/simulink/slref/simulinkprofiler.html
- https://www.mathworks.com/help/simulink/ug/understanding-total-time-and-self-time-in-profiler-reports.html
- https://in.mathworks.com/help/ti-c2000/ug/real-time-profiling.html
Obtaining Simulink Model execution loop rate with Simulink Profiler
3 次查看(过去 30 天)
显示 更早的评论
I was wondering what might be the best way to obtain the execution loop rate of my simulink model?
The method I am currently doing is by using Simulink profiler and then utilizing the Total time divided by the number of callbacks to get an approximation to my loop rate.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1608856/image.png)
For instance, in the above profiling session, ALUA_sim is the top level model, and using the above formula:
20.861/60971=0.00034214626s
I obtained 0.34ms loop rate (~3kHz). Would this be a reasonable approach?
0 个评论
采纳的回答
Sachin Lodhi
2024-2-13
Yes, this is a common way to get a rough estimate of the execution loop rate. The Simulink Profiler adds some overheads in the background to the functions or models being profiled. Since it gives the detailed execution time for each function during simulation, it is the “best” way to judge the distribution of simulation execution time among model components.
However, keep in mind that this is an average value. The actual time per loop might vary depending on what's being executed in each callback and other system loads that could affect the timing. If you need more precise measurements or if the loop rate is critical for your application, you might need to consider a more detailed analysis or real-time execution profiling.
Some useful links –
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!