Problem 106. Weighted average
Afficher commentaires plus anciens
function y = weighted_average(x,w)
f=x.*y;
f=sum(f);
y=f/length(x);
end
is there any error. i submit and get WA(wrong answer).
Réponse acceptée
Plus de réponses (1)
VELDANDI THARUN
le 10 Jan 2020
0 votes
function y = weighted_average(x,w)
y =(x*w.')/length(x)
end
Catégories
En savoir plus sur Time Series Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!