Error: Time object cannot be empty

조회 수: 21 (최근 30일)
Yuting
Yuting 2024년 10월 21일
댓글: Aditya 2025년 8월 19일 12:16
Hi matlab community,
when i tried to generate code from simulink, there is an error:
Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
Time object cannot be empty
I have tried the which codeInfo.mat -all methods, but it seems not helpful. When I restart the matlab again, it works once, but it always fails after the first run.
Best,
Yuting
  댓글 수: 4
Nikhil
Nikhil 2025년 1월 28일
Hi Rahul,
I am using R2022b, windows and I am getting same error when creating FMU.
Can you help me with resolving it.
Regards,Nikhil
Aditya
Aditya 2025년 8월 19일 12:16
Hey @Yuting were you able to solve this problem? seems like few poeple have faced this who are using multiple different version of matlab. I am using 2023b and still face this issue.
Please let me know how did you solve it?

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

답변 (1개)

Rahul
Rahul 2024년 10월 22일
I understand that you’re trying to generate code from a Simulink model, but instead getting an error stating “Time object cannot be empty”.
This is most likely caused by a second ‘codeInfo.mat’ file on the path, which can be identified using:
>> which codeInfo.mat -all
Then, remove the second file from the path, which is unrelated to the model. If this does not resolve the error message, you can try restoring the default MATLAB path. You can do so by running the following commands:
>> restoredefaultpath
>> rehash toolboxcache
>> sl_refresh_customizations
You might also consider saving your current path before you run the above commands.
Moreover, you can check out a similar MATLAB Answer regarding this issue:
More information can be found on MATLAB Answers post "How can I perform initial troubleshooting of MATLAB or Simulink errors?"
Hope it helps!

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by