How do I 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?

1 次查看(过去 30 天)
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

采纳的回答

madhan ravi
madhan ravi 2020-7-26
编辑:madhan ravi 2020-7-26
Wanted = matrix ./ reshape(scalar, 1, 1, []) % use bsxfun() for older versions for dividing

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by