フィルターのクリア

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 Center および File ExchangeSet Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by