Time object cannot be empty

When I built the code use grt. It caused error:
Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
  • Time object cannot be empty
How can I solve the problem and what the reason?

댓글 수: 7

Pavan Guntha
Pavan Guntha 2021년 10월 20일
Could you provide more information regarding the tool used to generate the code and attach the model/ code for debugging ?
Zihao Liu
Zihao Liu 2021년 10월 26일
I try to build DblLaneChange in matlab and try to export it as c++ code. After changes it as a discrete time model and try to build. Then it causes the error:
  • Time object cannot be empty
Thanks for your reply.
Alex Vicente
Alex Vicente 2021년 11월 11일
Hi @Liu,
Did you manage to solve it? I am having this error right now when tring to build my code.
Regards,
Alex
Daniela Yamashita
Daniela Yamashita 2021년 12월 9일
Hello, I have the same problem as well. I would be glad to know how to solve this problem
Onkar Vader
Onkar Vader 2022년 4월 5일
Do we have answer to this problem? The error statment is so vague, it is little difficult find root cause.
Have the same problem.
Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
Time object cannot be empty
Jeffrey
Jeffrey 2024년 2월 12일
I have the same problem. Is there a solution yet? It is not an issue of having duplicate codeInfo.mat files as stated in the answers.

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

답변 (4개)

Morgan Fremovici
Morgan Fremovici 2022년 5월 23일

1 개 추천

First verify that there are no duplicate "coderInfo.mat" files on the MATLAB path by entering the command
>> which codeInfo.mat -all
If there are more than one instances of this file, remove the one unrelated to the project from the path and try code generation again.
Philipp Kühl
Philipp Kühl 2023년 5월 22일

1 개 추천

The same problem occured for me, when I was compiling Simulink Models into C code using Embedded Coder. Since I was varying the subsystems I used Embedded Coder for, each time a new subfoulder was created in my current directory (name: "subsystemname_rtw"). They all contained a "codeInfo.mat". After I deleated the created folders, the error disappeared.
I assume that
>> which codeInfo.mat -all
and deleting all leftovers is a more elegant way, but the command just gave me an error. That's why I didn't know where to look for "codeInfo.mat"
Francesco
Francesco 2024년 2월 29일

0 개 추천

Hi all. We have the same issue also without others codeInfo.mat in the Matlab. We are building a model for real-time target. Did someone find out a definitive resolution to this problem?
Thanks in advance
Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
  • Time object cannot be empty
Aditya
Aditya 2025년 8월 19일
편집: Aditya 2025년 8월 19일

0 개 추천

Hi All,
matlab version: 2023b
I am modeling in simulink to run on imperix hardware. I am getting similar error. the model was running smoothly until this week. Now multiple different versions of my model are showing this error (these models were building before and succesfully running).
I tired deleting slprj and build folder, still this error exists.
>> which codeInfo.mat -all
'codeInfo.mat' not found.
seems like it is not even found.

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2021a

태그

질문:

2021년 10월 17일

편집:

2025년 8월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by