フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Need help on creating loop

1 回表示 (過去 30 日間)
Jack Sparrow
Jack Sparrow 2013 年 5 月 9 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Please I need assistance on this code, I am trying to matching two data. The first one is the training set, while the second one is the test set. They both contain 1 x 20 row vector each. Each cell in the vector is the value of an object length. Now I want to match the two data, such that the result is 19 x 20, instead of 20 x 20. Because test data number 1 should be match against all but itself and the same thing for the rest of the data. The computation is just the normal cumulative distribution function with mean 0 and standard deviation 1.
numtrainW = length(Wtrain);
numtestW = length(Wtest);
wscore = [];
for b=1:numtestW;
for d=1:numtrainW;
c_w = var(Wtrain);
Zw = abs(Wtrain(d)-Wtest(b,:))/c_w;
p_w = cdf('Normal',Zw,0,1);
Sw = 2*(1-p_w);
wscore = [wscore; Sw];
end
end
Thank you.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by