Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Error-cell array of strings

Asked by FIR on 17 Apr 2012
This question is closed and may reopen in the future if edited.
I get a error as  
Error using classperf (line 244)
When class labels of the CP object is a cell array of strings and
the classifier output is a numeric array, it must contain valid
indices of the class labels or NaNs for inconclusive results.
my code is 
data=[0.5 .3 0.6 0.5;0.2 0.3 0.5 0.9;0.1 0.7 0.2 0.8;0.5 .3 0.6 0.5;0.2 0.3 0.5 0.9;0.1 0.7 0.2 0.8]
 P=data(1:3,1:2);
 T=data(1:3,3);
  a=data(4:6,1:2);
  s=data(4:6,3);
  groups=[0;1;1;0;1;1]
  groups = cellstr(num2str(groups))
% 
    cvFolds = crossvalind('kfold', groups, 10);  %# get indices of 10-fold CV %# get indices of 10-fold CV
   cp = classperf(groups);  
   for i = 1:10   
       test = (cvFolds == i);  
     net = newrb(P',T');
  Y=sim(net,a')
%  
  test=[1;0;1]
cp = classperf(cp,Y',test);
%  
 end
 cp. CorrectRate
 cp. ErrorRate

please help

0 Comments

FIR

Tags

Products

No products are associated with this question.

0 Answers

Contact us