Find a raw position referred to a value in a matrix

1 view (last 30 days)
Hi given the following matrix
A = [110 220 330 440 550 660 770 880 990 1100;
220 330 440 550 660 770 880 990 1100 1210;
330 440 550 660 770 886 996 1106 1216 1326;
440 550 660 770 880 1002 1112 1222 1332 1442;
550 660 770 880 990 1112 1222 1332 1442 1552;
660 770 880 990 1100 1228 1338 1448 1558 1668;
770 880 990 1100 1210 1344 1454 1564 1674 1784;
880 990 1100 1210 1320 1460 1570 1680 1790 1900;
990 1100 1210 1320 1430 1576 1686 1796 1906 2016;
1100 1210 1320 1430 1540 1692 1802 1912 2022 2132;
1210 1320 1430 1540 1650 1808 1918 2028 2138 2248;
1320 1430 1540 1650 1760 1918 2028 2138 2248 2358;
1430 1540 1650 1760 1870 2028 2138 2248 2358 2468]
I would like to find the FIRST raw where we exceed the value 2000. In this case is the 9th raw
May someone can help me?

Accepted Answer

Adam Danz
Adam Danz on 10 Sep 2019
rowNum = find(any(A > 2000,2),1,'first');

More Answers (0)

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!