필터 지우기
필터 지우기

How to profile a Matlab function within a compiled Simulink program?

조회 수: 4 (최근 30일)
Using the Simulink analysis tool Profiler Report does not include the Matlab function and its subfunctions. I want to profile all subfunctions and calls within the Matlab function. Simulink does not allow the standard Matlab profiler to be present within the Matlab function since the code is to be compiled. Any suggestions?
I could create a dummy program in Matlab that runs the Matlab code within the Matlab function, but I would prefer not to because it's pretty massive.

채택된 답변

Matthew Lennon
Matthew Lennon 2017년 4월 26일
편집: Matthew Lennon 2017년 4월 26일
To profile execution time, tic and toc still work within matlab functions in simulink. Use disp('description here') to write a small description for each toc to know which component it relates to. Just remember that that the time is cumulative from each tic so add a new tic per section you'd like to evaluate or do the subtractions after.
  댓글 수: 1
Marcus Jansson
Marcus Jansson 2017년 4월 27일
Cheers Matthew, this was a compromise considering the effort I had to put in. I needed to add coder.extrinsic('disp'), coder.extrinsic('tic'), coder.extrinsic('toc') to make it work.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by