error-Inputs and targets have different numbers of samples.

1 回表示 (過去 30 日間)
FIR
FIR 2012 年 4 月 17 日
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 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by