更新时间:2022-06-21 22:57:51
use bsxfun
:
A = [ 1 2 3 4 5;
1 2 3 4 5;
1 2 3 4 5 ];
B = [ 1 10 100 1000 10000];
C = bsxfun(@times,A,B)
返回:
C =
1 20 300 4000 50000
1 20 300 4000 50000
1 20 300 4000 50000
对于 A'
和 B'
对于您的情况:
temp = bsxfun(@times,p_c_w,p_w)