>> CreateModel
Index exceeds the number of array elements (531).
Error in CreateModel (line 14)
d(i,j)=abs((x(i)-x(j))^2+(y(i)-y(j))^2);

댓글 수: 4

Torsten
Torsten 2022년 12월 2일
Most probably, the arrays x and/or y have only 531 elements, but the index i and/or j become bigger than 531. The consequence is an access violation which makes MATLAB error.
Torsten
Torsten 2022년 12월 2일
@Wonseh comment moved here:
How can I solve this?
Torsten
Torsten 2022년 12월 2일
By making the loops over i and j not exceed 531 for the values of i and j.
Jon
Jon 2022년 12월 2일
For future reference it is helpful to have the subject of your question provide a quick summary of the specific problem you are having. So rather than "Can someone help please", it would be better to have something like, "Why do I receive Index exceeds number of array elements error?" That way people who have either expertise and/or interest in helping you solve the problem can know to look at it, without having to first open the question just to see what kind of help you need.

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

답변 (1개)

Marcel
Marcel 2022년 12월 7일

0 개 추천

I'd recommend using keywords to make a short and nice title for questions

카테고리

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

제품

릴리스

R2020a

질문:

2022년 12월 2일

답변:

2022년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by