Suppose I have a matrix M = ones(3); , and I want to split each line into another number, for example, C = [1;2;3]; .
1 1 1 -divide_by-> 1 1 1 1 1 1 1 -divide_by-> 2 = 0.5 0.5 0.5 1 1 1 -divide_by-> 3 0.3 0.3 0.3
How to do this without using loops?
matrix matlab division rows
adn
source share