Attempted to access tfMatrix(0,1); index must be a positive integer or logical. Error in modellingPLSA (line 25) tfMatrix(wordNumber,documentNumber) = tfMatrix(wordNumber,documentNumber) + 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
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 Center および File Exchange で Text Data Preparation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!