Subscripted assignment dimension mismatch.

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);

답변 (1개)

Jan
Jan 2018년 1월 26일
편집: Jan 2018년 1월 26일

0 개 추천

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?

이 질문은 마감되었습니다.

질문:

2018년 1월 25일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by