二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。
例:
二つのベクトル [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 Solvers422
Suggested Problems
-
Back to basics 22 - Rotate a matrix
933 Solvers
-
Set the array elements whose value is 13 to 0
1437 Solvers
-
551 Solvers
-
Integer Sequence - II : New Fibonacci
676 Solvers
-
Test Problem; Create a 5x5 array containing all ones
403 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".