필터 지우기
필터 지우기

Analze running time of simulation

조회 수: 2 (최근 30일)
Max
Max 2017년 8월 23일
답변: Eeshan Mitra 2017년 8월 25일
Hi,
I'd like to analyze the running time of my simulink model without time for compiling.
My understanding is, if I use
tic
sim(modelName)
toc
the compiling time is measured as well.
Another idea could be the profiler? But then my Simulation gets very slow, so I'm not sure, whether this result is correct.
Has anybody a idea?
Thanks in advance.

답변 (1개)

Eeshan Mitra
Eeshan Mitra 2017년 8월 25일
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 performance of just the "simulation phase".
However, if you do not want to recompile your Simulink model, say for different iterations, consider using the "Fast Restart" option with "tic-toc". Find more information about the "Fast Restart" option in the following link:
Consider the simulation of the model "vdp" with a MATLAB script:
for i=1:4
tic
sim('vdp','FastRestart','on');
toc
end
The first run of the model involves compilation, but not the three subsequent ones. The timing adheres more to the "simulation phase" in the last three simulations.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by