Index exceeds the number of array elements

조회 수: 4 (최근 30일)
Blazej Staniak
Blazej Staniak 2021년 11월 12일
댓글: KSSV 2021년 11월 15일
Hello, matlab shows me this problem:
Index exceeds the number of array elements (495).
Error in Untitled22222 (line 34)
if suma(i)== 0
I mean exactly this loop, I got a little lost and I don't know what to do next.
while 1
if suma(i)== 0
p_kolumna=i;
break;
end
i=i+1;
end
Thank you for your help
  댓글 수: 10
KSSV
KSSV 2021년 11월 12일
What is size of the imahe im1.
im1 = imread('Audi_1.jpg');
Blazej Staniak
Blazej Staniak 2021년 11월 12일
1632x3264x3

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

답변 (2개)

KSSV
KSSV 2021년 11월 12일
Replace the while loop condition:
while 1
with
while i<=length(suma)
It eill not give the error..but still I am surprised what for this while loop is.
  댓글 수: 4
Blazej Staniak
Blazej Staniak 2021년 11월 12일
p_kolumna is definded in the loop, how to repair?
KSSV
KSSV 2021년 11월 15일
It is defined... But in the while loop suma will never be zero and it will never take the defined value. What is your problem exactly?

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


Blazej Staniak
Blazej Staniak 2021년 11월 15일
편집: Blazej Staniak 2021년 11월 15일
does anyone know how to solve

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by