Subscripted assignment dimension mismatch.

조회 수: 6 (최근 30일)
Andrew Oldnall
Andrew Oldnall 2019년 1월 10일
댓글: Andrew Oldnall 2019년 1월 11일
Hi there,
I'm writing a piece of code for facial recognition and i am getting the error message 'Subscripted assignment dimension mismatch.' on a certain section of the code;
faceDatabaseFeatures = zeros(size(faceDatabase,2)*faceDatabase(2).Count,4280);
featureCount = 1;
for i=1:size(faceDatabase,2)
for j = 1:faceDatabase(i).Count
faceDatabaseFeatures(featureCount,:) = extractHOGFeatures(read(faceDatabase(i),j));
faceDatabaseLabel{featureCount} = faceDatabase(i).Description;
featureCount = featureCount + 1;
end
personIndex{i} = faceDatabase(i).Description;
end
Under
faceDatabaseFeatures(featureCount,:) = extractHOGFeatures(read(faceDatabase(i),j));
I believe it is here that the problem is occuring but i cannot for the life of me see why it is giving me that error.
This is the image of my workspace, any help would be much apperciated.
Andrew
  댓글 수: 7
Adam
Adam 2019년 1월 11일
What does
which -all imageSet
show on that line if you put a breakpoint on that line and put the above on the command line?
Andrew Oldnall
Andrew Oldnall 2019년 1월 11일
C:\Program Files\MATLAB\R2015a\toolbox\vision\vision\imageSet.m % imageSet constructor

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2019년 1월 11일
편집: Jan 2019년 1월 11일
I looks like it does show, which line is failing:
queryImage = sample(sample(person),j);
Use the debugger to examine the problem. Type this in the command window:
dbstop if error
Now run the code again. When it stops at this line, try this:
person
sample(person)
j
sample(sample(person),j)
What do you observe?
  댓글 수: 1
Andrew Oldnall
Andrew Oldnall 2019년 1월 11일
I still get this error when doing that;
Error using subsindex
Function 'subsindex' is not defined for values of class 'imageSet'

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by