フィルターのクリア

How to get system time into simulink desktop real time?

10 ビュー (過去 30 日間)
Giada
Giada 2023 年 5 月 17 日
回答済み: Sandeep 2023 年 5 月 26 日
Hi!
is there a way to read from simulink the system time (not the simulation time)...I tried a code I had found in Matlab answers, however it doesn't work....
This was the matlab function that doesn't work:
function [Y, M, D, H, MN, S] = sysClock()
coder.extrinsic('clock');
Y = 0;
M = 0;
D = 0;
H = 0;
MN = 0;
S = 0;
[Y, M, D, H, MN, S] = clock;
end
Error: 'extrinsic function 'clock' is not available for standalone code generation. It must be removed to generate standalone code. It could not be eliminated because its outputs seem to affect the calling function. Fix this error by avoiding using 'clock' or making sure its outputs are unused.
PS: I also tried the 'now' function, but it does not work.

回答 (1 件)

Sandeep
Sandeep 2023 年 5 月 26 日

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by