I want to divide each row of a matrix with corresponding element in another matrix .Please help.
78 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Più risposte (2)
First Last
il 28 Mar 2018
Modificato: First Last
il 28 Mar 2018
Make sure B is transposed to a column vector, i.e.,
C=A./B';
0 Commenti
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!