How to eleminate 'clock' error generated during code generation.

1 回表示 (過去 30 日間)
Ashwini
Ashwini 2013 年 6 月 10 日
Hi all In my model I need to know what time of the day it is. So I have written a matlab function that uses matlab function 'clock'.I get back an array, which i read to extract the time of the day. The problem starts only when I try to generate c code from the model, I get the following error :'Failed to eliminate a call to the MATLAB function 'clock'. For non-simulation builds, calls to unsupported MATLAB functions are eliminated if they do not affect function outputs.'
What can I do as to eliminate this error and be able to read in system time and also be able to generate c code with it?
  2 件のコメント
Chethan
Chethan 2013 年 6 月 10 日
Would you please post a part of your code from where you are getting error
Ashwini
Ashwini 2013 年 6 月 13 日
This is a part of my code where the error occurs
coder.extrinsic('clock');
strc = zeros(6,1,'double'); strc = fix(clock);

サインインしてコメントする。

採用された回答

Vishal Rane
Vishal Rane 2013 年 6 月 10 日
Refer this list of functions allowed from code gen perspective :
One way would be to use a C/C++ equivalent of the 'clock' function in the form of sfunc.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by