How to use "coderTimeSleep" to pause the code of matlab function block in Simulink.

11 ビュー (過去 30 日間)
Alejandro
Alejandro 2023 年 5 月 9 日
回答済み: Mayank Sengar 2023 年 5 月 22 日
I want to pause the code of a matlab function block in Simulink when i'm going to generate generate C code to run on Arduino hardware.
I use the source code "coder_posix_time" and i load the files .c and the header .h successfully on the custom code.
How i run the function "coderTimeSleep" to pause the code x secs? What syntax do i have to use?
i have used coder.ceval("coder_posix_time",u); but is not working.

回答 (1 件)

Mayank Sengar
Mayank Sengar 2023 年 5 月 22 日
You can use pause(n) function to pause execution of function for n seconds.
Kindly leverage following documentation for the same:
There are also other ways to do pause execution temporarily mentioned in the following MATLAB answer.

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by