Problem 106. Weighted average
Ältere Kommentare anzeigen
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).
Akzeptierte Antwort
Weitere Antworten (1)
VELDANDI THARUN
am 10 Jan. 2020
0 Stimmen
function y = weighted_average(x,w)
y =(x*w.')/length(x)
end
Kategorien
Mehr zu Just for fun finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!