I want to divide each row of a matrix with corresponding element in another matrix .Please help.
81 views (last 30 days)
Show older comments
For eg: I have a matrix
A=[9 6 3;
4 2 8;
1 0 0;]
divide A by B=[3 2 1] to get the result
C=[3 2 1;
2 1 4;
1 0 0;]
0 Comments
Accepted Answer
More Answers (2)
First Last
on 28 Mar 2018
Edited: First Last
on 28 Mar 2018
Make sure B is transposed to a column vector, i.e.,
C=A./B';
0 Comments
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!