Removing matrix rows after the first element of a row becomes too big
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sean
am 14 Jul. 2014
Kommentiert: Sean
am 14 Jul. 2014
I want to remove all of the rows in A after the element of the first column of the nth row passes, say 10. Let A be
A = [ 1 1 1 1 1 1 1 1 1
3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4
7 7 7 7 7 7 7 7 7
8 8 8 8 8 8 8 8 8
10 10 10 10 10 10 10 10 10
11 11 11 11 11 11 11 11 11
25 25 25 25 25 25 25 25 25 ]
How do I do this without knowing what row the first element will be larger than 10 at?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 14 Jul. 2014
Bearbeitet: Azzi Abdelmalek
am 14 Jul. 2014
[ii,jj]=find(A>10,1);
A(ii:end,:)=[]
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!