I want to divide each row of a matrix with corresponding element in another matrix .Please help.
75 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(2 个)
First Last
2018-3-28
编辑:First Last
2018-3-28
Make sure B is transposed to a column vector, i.e.,
C=A./B';
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!