Please help me to fix Index exceeds matrix dimensions error.
Afficher commentaires plus anciens
My code is...
imgListFile = fopen('D:\image_class.txt', 'r');
F = zeros(6, 24); L = cell(6, 1);
tline = fopen(imgListFile); currentLine = 1;
while ischar(tline)
for i = 1 : length(srcFiles)
disp(tline)
splittedLine = regexp(tline, ',[ ]*', 'split');
srcFiles = dir('D:\My old data\Heatmap\my\imgs\*.jpg'); % the folder in which ur images exists
filename = strcat('D:\My old data\Heatmap\my\imgs\',srcFiles(i).name);
I = imread(filename);
% Extract the SFTA feature vector from the image.
imagePath = fullfile('imgs',splittedLine{1});
f = sfta(I, 4);
F(currentLine, :) = f;
% Store the image label.
L{currentLine} = splittedLine{2};
tline = fgetl(imgListFile);
currentLine = currentLine + 1;
end
end;
fclose(imgListFile);
My error is...
Error in Nb (line 21) L{currentLine} = splittedLine{2};
Réponses (2)
splittedLine{2} seems to have fewer than 2 cells.
Catégories
En savoir plus sur Image Preview and Device Configuration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!