필터 지우기
필터 지우기

Cell contents reference from a non-cell array object error

조회 수: 3 (최근 30일)
Lester Lim
Lester Lim 2013년 1월 23일
Error: Cell contents reference from a non-cell array object. I know that a input must be a cell array but thin is I don't know where went wrong when I put in a cell array...
Here's the code:
function subset = GetClassSubsetIndexes(classes)
subset=[];
oldClassLabel = 'nekaLabela';
for i=1 : 1 : length(classes)
if oldClassLabel ~= classes{i}
oldClassLabel = classes{i};
subset = cat(1, subset, i);
end
end
%now put end indicies
for i=2 : 1 : size(subset,1)
endIndex = subset(i, 1);
subset(i-1, 2) = endIndex-1;
end
subset(size(subset,1), 2) = length(classes);
end
Need help Thanks!!! Ps: please don't close the question, it's quite important to me...
  댓글 수: 4
Lester Lim
Lester Lim 2013년 1월 23일
For == it gives the same error, class(classes) gives the following error: For colon operator with char operands, first and last operands must be char.
Walter Roberson
Walter Roberson 2013년 1월 23일
if ~strcmp(oldClassLabel, classes{i})
The bit about colon operators makes no sense unless the class() call itself has been shadowed.
Right after the "function" line, for the moment please put
which -all class
whos classes
and show us the output.

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 1월 23일
Your code is written to assume that LDA is called with the second parameter being a cell array of strings, but you are instead calling it with the second parameter being a column vector of double (such as a class number.)
  댓글 수: 38
Lester Lim
Lester Lim 2013년 1월 24일
Got another problem, hoping you could help, the dimensions don't agree but the double works. The testSample is supposed to be the picture I want to classify right?
Lester Lim
Lester Lim 2013년 1월 24일
Also, the new problem is none other than out of memory...Im crying...

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Set Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by