필터 지우기
필터 지우기

Attempted to access tfMatrix(0,1); index must be a positive integer or logical. Error in modellingPLSA (line 25) tfMatrix(w​ordNumber,​documentNu​mber) = tfMatrix(w​ordNumber,​documentNu​mber) + 1;

조회 수: 1 (최근 30일)
data = dlmread('fichier.txt','\t');
[m,n] = size(data);
doc_length = 4;
documents = floor((44*60+12)/doc_length);
windowSize = 20;
words = (280/windowSize+1)*(360/windowSize)*5*2;
FramesForWords = cell(words,documents);
for i=1:words
for j=1:documents
FramesForWords{i}{j} = [];
end
end
tfMatrix = zeros(words,documents);
for row=1:size(data,1)
i = data(row,1);
j = data(row,2);
frame = data(row,3);
opticalFlow = data(row,4);
blobSize = data(row,5);
documentNumber = uint16(floor(frame/(25*doc_length)))+1;
wordNumber = ((i/windowSize)*18+(j/windowSize))*10 + opticalFlow*2 + blobSize + 1;
tfMatrix(wordNumber,documentNumber) = tfMatrix(wordNumber,documentNumber) + 1;
FramesForWords{wordNumber}{documentNumber} = [FramesForWords{wordNumber}{documentNumber};frame];
if documentNumber == documents
break
end
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 11월 29일
As we do not have the data from the file, we have no reason to expect that wordNumber will come out as a positive integer.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by