How can I measure the processing time of MATLAB Function Block?

4 ビュー (過去 30 日間)
Dongho You
Dongho You 2019 年 3 月 11 日
回答済み: Easwar Kumar Yarrabikki 2019 年 3 月 11 日
Hi, All.
As the below image, I created a MATLAB function block and want to measure its processing time (not the whole simulation time).
Thank you for your help in advance.
capture.PNG

回答 (1 件)

Easwar Kumar Yarrabikki
Easwar Kumar Yarrabikki 2019 年 3 月 11 日
Can you try putting a tic in the begining of your MATLB code and toc at the end of your code.
function time_taken= example_test_function()
tic
your code
time_taken=toc;
This should hopefully give you the time taken for each iteration. incase if MATLAB code generator complaints about tic and toc usage in MATLAB fnction, try Coder.extrensic to aviod code gen issues.

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by