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".
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
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 commentaires
Joseph Cheng
le 12 Sep 2014
check to see if dy or dx is a real positive integer.
Fox Peterson
le 12 Sep 2014
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...
Réponses (0)
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!