how find last row<>0
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
a=[3 4 5 0 3 4 0;4 5 0 0 0 0 0;0 0 0 0 0 0 0]
a =
3 4 5 0 3 4 0
4 5 0 0 0 0 0
0 0 0 0 0 0 0
i want to know the last rows wich element are ==0 ..solution idx=2!
i try this solution :find(sum(a,2)==0)-1 but it's no good because example :the sum 3 3 0 -3 -3 0 =0 but is not correct
2 Commenti
Dyuman Joshi
il 12 Ago 2023
Your phrasing is not clear (atleast to me).
a=[3 4 5 0 3 4 0;4 5 0 0 0 0 0;0 0 0 0 0 0 0]
As you said, the output for the above array is 2, what is the logic behind that?
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Get Started with MATLAB 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!