MATLAB: How to multiply a matrix with scalar

image processingmatrix manipulation

I have 49 matrix which i call them as atom. I want to multiply each atom with a 49 different scalar value. ie atom1*h1+atom2*h2 …….atom49*h49.
A = rand(361,49);
B = reshape(A,19,19,1,49);
H = radn(49,1);

Best Answer

A = rand(361,49);
B = reshape(A,19,19,1,49);
H=rand(49,1);
A = zeros(19,19) ;
for i = 1:49
A = A+H(i)*B(:,:,1,i) ;
end