Index exceeds the number of array elements (1).

조회 수: 79 (최근 30일)
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 10월 14일
댓글: Pitchai 2025년 8월 22일
I ran a file, but an error appears in the follownig line:
Refset=sol(iii(1:first_members),:);
with the message: Index exceeds the number of array elements (1).
What does it mean? Thank you.
  댓글 수: 3
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 10월 14일
thank you very much
Pitchai
Pitchai 2025년 8월 22일
I run the circuit inmatlab , the error will come this type please help me to clear the error "Index exceeds the number of array elements. Index must not exceed 17"

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 10월 14일
The error means you are trying to index a vector/array element that does not exist in your variable. Specifically, your error message is telling you your array has a single element, and your index is >1.
% Works
A = 27;
A(1)
ans = 27
% doesn't work
A(2)
Index exceeds the number of array elements. Index must not exceed 1.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by