Index exceeds the number of array elements

1 次查看(过去 30 天)
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');

请先登录,再进行评论。

回答(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 的更多信息

标签


Translated by