error-Inputs and targets have different numbers of samples.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!