필터 지우기
필터 지우기

Index in position 2 exceeds array bounds. Index must not exceed 7?

조회 수: 3 (최근 30일)
Hajar Alshaikh
Hajar Alshaikh 2022년 11월 17일
답변: Rik 2022년 11월 17일
When I run my program some times work and alot of times got this message and I dont know why:
Index in position 2 exceeds array bounds. Index must not exceed 7.
Error in
N1(1,i)=f(n-j,i+j);
my code is :
N1=f(n,:);
for i=1:size(f,1)
if isnan(N1(1,i))
for j=1:size(f,1)
N1(1,i)=f(n-j,i+j);
if ~isnan(f(n-j,i+j))
break
end
end
end
end

채택된 답변

Rik
Rik 2022년 11월 17일
Since i and j both range from 1 to the number of rows in f, there is no reason i+j will be less than the number of columns in f.
Since you wrote no comments and didn't use understandable variable names, I cannot provide you with a suggestion for a fix.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by