TP-traitement-audio-visuel/TP9/kaczmarz.m
2023-06-22 20:47:16 +02:00

19 lines
279 B
Mathematica

function f = kaczmarz(f, p, W)
n_mesures = size(p, 1);
W = W';
norm_W = sum(W.^2, 1);
for i = 1:n_mesures
Wi = W(:,i)';
norm_Wi = norm_W(i);
if norm_Wi > 0
f = f + (p(i) - Wi * f) / norm_Wi * Wi';
end
end
end