This answer worked fine. However, now I realize that I need the value of m that matches the value of n found by the answer.
Find the first element of a column in a matrix that has a value equal to zero
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Robert Demyanovich
il 3 Giu 2021
Commentato: Robert Demyanovich
il 4 Giu 2021
I have an m by n matrix and I'm interested in the nth column. Initially all of the values in the nth column are greater than zero. As the code executes, at some point, a specific row in the nth column will equal zero. I want to determine which row that is. One issue is that after this first instance of zero, all of the subsequent rows in the nth column will also equal zero. I just want the first row in the last column that has a value of zero.
Risposta accettata
Dyuman Joshi
il 3 Giu 2021
r=find(A(:,n)==0,1) %A is your m by n matrix after executing the code
0 Commenti
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!