Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Need help on creating loop

1 visualización (últimos 30 días)
Jack Sparrow
Jack Sparrow el 9 de Mayo de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by