二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。
例:
二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、
それぞれの要素ごとの積の平均を取ると、
解は 33.3333 となります。
途中の計算は (1*10 + 2*15 + 3*20)/3 のようになります。
- (英語版) Problem 106. Weighted average <https://www.mathworks.com/matlabcentral/cody/problems/106>
Solution Stats
Problem Comments
6 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers419
Suggested Problems
-
Project Euler: Problem 3, Largest prime factor
1785 Solvers
-
Arrange vector in ascending order
814 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
397 Solvers
-
2497 Solvers
-
713 Solvers
More from this Author12
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
That's not the correct definition of the concept of "weighted average". Instead, it's rather the average product of two data vectors x and w.
I agree with yurenchu. If you want to choose Problems to translate, then first read all comments made about the original Problem statement to see if there are any important critiques to heed. If so, then either address the critiques and create an improved version of the Problem, or else choose a different original Problem.
Changed the translation
Very good :-)
can someone translate please?
@Yacine in a nutshell: "calculate the average of the element-wise product of two vectors".