how to find the weighted sum of two matrices of order 2778x6, the same is like this. any suggestion.
1 次查看(过去 30 天)
显示 更早的评论
let A=[1 2 3 4 5 6; 2 3 4 5 6 7; 4 5 6 7 8 9] B=[2 3 4 5 6 7; 5 6 7 8 9 2; 1 2 3 4 5 6]
0 个评论
回答(1 个)
Lukas
2018-8-16
I assume, you want to calculate the sum of each matrix element. Weights are defined for each matrix (and usually sum up to 1). Then this is, e.g.:
C = 0.1*A + 0.9*B
If you want to have weights for each element (in A and B), this is:
w = rand(size(A)) % a random weight matrix
C = w.*A + w.*B
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!