ERROR : "Expected a value representable in the C type 'int'. Found 108301 instead."
이전 댓글 표시
I'm using MATLAB function blocks in Simulink. but there were some errors about data type. I can't understand the error messages. what made this error?
<<

>>
댓글 수: 6
Prajith Chilummula
2018년 2월 22일
편집: Prajith Chilummula
2018년 2월 22일
As you said it may be due to some datatype mismatch. But I am unable to make any conclusions from this error log. So it would be better if you share the matlab function code or the model to further investigate on this.
Peter S
2018년 11월 2일
I am having the same error message with a very simple embedded MATLAB function in Simulink:
function AT_OnTime = ParseCmd(AT_OnCmd,time,dt)
ind = time/dt+1;
AT_OnTime = AT_OnCmd(ind,2);
end
Jinhang Li
2020년 4월 9일
Have you solved this problem, bro? I am been puzzled by the same problem for several days while dealing with a 4-D signal. This error log is really confusing.
Michal Semonský
2020년 7월 4일
Hi, Peter S,
the error could be in your variable ind data type - this should be set as integer type by using functions like ind=uint8(ind), uint16(), uint32(), ...depends on the maximal value which ind could be (for uint16 it is 65535). Variable AT-OnCmd seems like a matrix and the indexing variable should be always integer non-negative type.
Amir
2024년 2월 25일
I have had the same problem in simulink recently. The error is due to indexing an array with a variable that isn't an intiger. For example, you may have used Tau_Plaus = tk(j+1) in one of your blocks where j is 1.00000. I would fix this problem by using tk(round(j+1)).
hanyu
2025년 3월 11일
thanks,it's useful
답변 (1개)
Andrew Sol
2019년 5월 1일
0 개 추천
You may try use block "Data Type Conversion", and convert input signal for MATLAB Fcn Block to uint8.
카테고리
도움말 센터 및 File Exchange에서 Simulink 함수에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!