How do you divide each row by its first nonzero element?
Afficher commentaires plus anciens
How you would divide each row by its first nonzero element? For example, if I have a matrix A=[1 9 7;0 2 4;0 0 5], I want it to be [1 9 7;0 1 2; 0 0 1] where the diagonals of the matrix are 1s. As you can see, I want the first row and all of its columns to be the same. Would it also be possible to have the code for this problem be 1 line?
2 commentaires
Stephen23
le 30 Oct 2017
What do you mean that you "want... all of its columns to be the same"?
jones matthew
le 30 Oct 2017
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!