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 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Walter Roberson
le 29 Nov 2015
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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!