Problem 44400. 二つのベクトルの要素ごとの積の平均を計算しよう
二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。
例:
二つのベクトル [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
Show
3 older comments
David Verrelli
on 13 Dec 2017
Very good :-)
Yacine
on 1 Oct 2024
can someone translate please?
Christian Schröder
on 2 Oct 2024
@Yacine in a nutshell: "calculate the average of the element-wise product of two vectors".
Solution Comments
Show commentsGroup

Matrix Patterns III
- 12 Problems
- 47 Finishers
- Make a diamond
- Dice face matrix!
- Produce the following matrix
- Check if a matrix is a palindrome in all directions
- Form a square matrix from four square sub-matrices
- Create a square matrix with given conditions
- create a square matrix
- Tent matrix
- Vandermonde Matrix
- Union Jack Matrix
- Make a rainbow matrix (follow-up to checkerboard matrix)
- Diagonal Pattern
Problem Recent Solvers391
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!