error-Inputs and targets have different numbers of samples.

4 visualizaciones (últimos 30 días)
FIR
FIR el 17 de Abr. de 2012
I have a code
P1 = [-1 -1 2 2; 0.3 5.3 0.3 5.4]; Tar = [0 ;1 ]
indices=crossvalind('kfold',Tar,10); for i=1:10 test=(indices==i);trains= ~test tst = (indices==i); val = (indices== mod(i+1,10)); trn = ~[tst,val]; net=newff(P1(:,trains),Tar(trains),1); net=init(net);
[net,tr]=train(net,P1(:,trains),Tar(trains));
out = round(sim(net,P1(:,test)));
end
I get error a s
Error using trainlm (line 109) Inputs and targets have different numbers of samples.
Error in cfour (line 60) [net,tr]=train(net,P1(:,trains),Tar(trains));
please help

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by