Subscripted assignment dimension mismatch.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
I was following the SimpleFaceRecognition example from Matlab and while running the code I am getting this error. I am totally new to matlab
Subscripted assignment dimension mismatch.
trainingFeatures(featureCount,:) = extractHOGFeatures(read(training(i),j));
Here is the code
Display Query Image and Database Side-Side
personToQuery = 1;
galleryImage = read(faceDatabase(personToQuery),1);
figure;
for i=1:size(faceDatabase,2)
imageList(i) = faceDatabase(i).ImageLocation(5);
end
subplot(1,2,1);imshow(galleryImage);
subplot(1,2,2);montage(imageList);
diff = zeros(1,9);
2 Comments
Jan
on 25 Jan 2018
Please post the complete error message.
MAYOOGH GIRISH
on 26 Jan 2018
Edited: Jan
on 26 Jan 2018
Answers (1)
If the code from the FileExchange fails, asking the author is a good point to start from. Another idea is to use the debugger by your own at first:
dbstop if error
Then run the code again. When Matlab stops, check the dimensions of the used arrays:
i
j
a = read(training(i),j)
size(a)
b = extractHOGFeatures(a)
size(b)
featureCount
size(trainingFeatures);
size(trainingFeatures(featureCount, :))
What do you observe? Do the sizes of
size(trainingFeatures(featureCount, :))
extractHOGFeatures(read(training(i),j));
match? If not, do the real sizes tell you anything suspicious?
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!