필터 지우기
필터 지우기

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