Problem 106. Weighted average
Show older comments
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).
Accepted Answer
More Answers (1)
VELDANDI THARUN
on 10 Jan 2020
0 votes
function y = weighted_average(x,w)
y =(x*w.')/length(x)
end
Categories
Find more on Time Series Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!