Simulink Matlab system block with timetable error

조회 수: 1 (최근 30일)
gregory pais
gregory pais 2023년 12월 15일
댓글: gregory pais 2024년 1월 3일
In my class derivated from matlab.System I use a timetable property initialized with the function array2timetable from a matrix of size 1460*1441 double elements
I use further this timetable in my code and in Matlab and all run without issue.
But when I use it in Simulink throught a Matlab system object I have this error after ctrl+D
Simulink detected an error 'Unable to determine a common type for all cell elements due to failed loop unrolling.'. The error occurred for MATLAB System block 'test/MATLAB System'. See line 45, column 35 in file 'C:\Program Files\MATLAB\R2022b\toolbox\matlab\datatypes\codegen\tabular\+matlab\+internal\+coder\@tabular\extractData.m'. The error was detected during size propagation phase.
After many test I find this error is due to my timetable exceeds 1100 variables when I create a timetable with an array of 1460*1100 double elements this error is not rised.
How to solve this issue ? any configurations parameters?

채택된 답변

Jaynik
Jaynik 2023년 12월 29일
Hi Gregory,
I understand that MATLAB code executes without any issue when using 'timetable' but you are encountering an error when integrating the code within Simulink through a MATLAB "System" block.
It is difficult to provide you a specific answer without investigating the actual model. While the code for "timetable" runs without any errors on MATLAB, there are some limitations to it when it comes to Simulink. It is recommended to go through the following documentation which outlines the limitations for code generation with "timetables":
Alternatively, if possible, try reducing the complexity of the timetable by limiting the number of variables or the size of the data. If your application permits, dividing the timetable into smaller segments could be a viable workaround.
Hope this helps!
  댓글 수: 1
gregory pais
gregory pais 2024년 1월 3일
Finaly, due to the size limitations of timetable after compilation phase I used a simple double matrix to store all the datas and I lose the timetable data struct. Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Transmitters and Receivers에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by