MATLAB: How to take one matrix, divide by another, to make a bunch of new matrices with the dimension of the original matrix, but each scaled by each element of the second matrix

matrix divisionscalar division

Hello!
I have a question. I have a matrix, 91 by 93, and i want to divide each element of the matrix by a scalar. However, I have a large amount of scalars in an array, and I want to create many 91 by 93 matrices each scaled by each element in the array. How would I do this quickly and simpy without having to single out each value in the array and dividing it? Also, would it be possible to store all these 91 by 93 matrices in a single matrix/variable?
If I am not clear please comment to let me know
Thanks!
-Kevin

Best Answer

Wanted = matrix ./ reshape(scalar, 1, 1, []) % use bsxfun() for older versions for dividing