MATLAB coder Error evaluating test code Caused by: Index exceeds matrix dimentions

조회 수: 1 (최근 30일)
I solved it, thanks

채택된 답변

Walter Roberson
Walter Roberson 2018년 5월 22일
편집: Walter Roberson 2018년 5월 22일
Xstep=1:3.5/24:24;
is not guaranteed to have exactly the same number of elements in generated code.
Why are you doing "for comp=1:s; end" without any code in there? Why are you "if dx>Xstep(NR)" after that with no code inside the "if" ?
Your code generates index out of range even in MATLAB.
Your dx is greater than any Xstep() value. It is not surprising that you go past the end of the array.
  댓글 수: 1
Martin Andersson
Martin Andersson 2018년 5월 22일
Hi I simplyfied the code to just show the error (and have now also change the Xstep so it runs i MATLAB, but I still get the same error in MATLAB Coder)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by