Index exceeds matrix dimensions.

1 回表示 (過去 30 日間)
Ria Anggraini
Ria Anggraini 2015 年 6 月 17 日
回答済み: Ingrid 2015 年 6 月 17 日
... % some listing
temp=imcrop(final,[tempX tempY tempL tempW]);
I=im2bw(temp,0.5);
... % some listing
for k=1:2:length(line1)
Ik=imcrop(Ib,[1 line1(k) kol line1(k+1)-line1(k)]);
when i run it, it said error in:
Index exceeds matrix dimensions.
Ik=imcrop(Ib,[1 line1(k) kol line1(k+1)-line1(k)]);
I appreciate some help. Thankyou.

回答 (1 件)

Ingrid
Ingrid 2015 年 6 月 17 日
since you are also indexing to k+1 you cannot go all the way to the end of line1!
for k=1:2:length(line1)-1
Ik=imcrop(Ib,[1 line1(k) kol line1(k+1)-line1(k)]);

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by