TP-traitement-audio-visuel/TP3_dams/probabilites_EM_n.m

13 lines
339 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
function probas = probabilites_EM_n(D_app,parametres_estim,n,sigma)
n_app = length(D_app);
probas = zeros(n,n_app);
p = zeros(1,n);
for i = 1:n_app
for j = 1:n
p(j) = 1/n/sigma * exp(-calcul_r(D_app(:,i),parametres_estim(j,:)).^2 / (2*sigma^2));
end
probas(:,i) = p/sum(p);
end
end