Info

此问题已关闭。 请重新打开它进行编辑或回答。

I am trying to run the following code. i am getting an error in line 15 as "Subscript indices must either be real positive integers or logicals".

1 次查看(过去 30 天)
mbCount = 1; for i = 1:mbSize:row-mbSize+1 for j = 1:mbSize:col-mbSize+1
% dy is row(vertical) index
% dx is col(horizontal) index
% this means we are scanning in order
dy = motionVect(1,mbCount);
dx = motionVect(2,mbCount);
refBlkVer = i + dy;
refBlkHor = j + dx;
imageComp(i:i+mbSize-1,j:j+mbSize-1) = imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1); --line 15
mbCount = mbCount + 1;
end
end
Kindly help me. Thanks in advance.
  2 个评论
Fox Peterson
Fox Peterson 2014-9-12
also check on mbSize (is a real positive integer?) , since it's in the range definitions for i and j. also, are there instances where col-mbSize + 1 or row - mbSize + 1 could be less than 1? for example, if mbSize is 20 and col is 10, then 1:20:10-20+1 would not work...

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by