Skip to main content
edited tags; edited tags
Link
Tweeted twitter.com/StackMma/status/918534357459103744
I felt that the answers went beyond a simple solution, and that offer quite interesting perfomance tuning. However, this is just a personal oppinion and may be discarde....
Link
added 8 characters in body; edited title
Source Link
David G. Stork
  • 42.3k
  • 3
  • 37
  • 106

Picking first row of a matrix with a positive first elemetelement

I have a table of order 30 X 3$30 \times 3$. I want to pick a row from this table which is first to have its first element to be positive, irrespective of the values of the rest two elements.

For example, if

T = {{-2, 1, 2}, {-4, 2, 5}, {-6, 4, 3}, {-2, 2, 1}, {2, 4, 4}, {1, 5, 3}}

howHow can I tell MthematicaMathematica to pick the row {2, 4, 4} from the T.

Picking first row of a matrix with a positive first elemet

I have a table of order 30 X 3. I want to pick a row from this table which is first to have its first element to be positive, irrespective of the values of the rest two elements.

For example, if

T = {{-2, 1, 2}, {-4, 2, 5}, {-6, 4, 3}, {-2, 2, 1}, {2, 4, 4}, {1, 5, 3}}

how can I tell Mthematica to pick the row {2, 4, 4} from the T.

Picking first row of a matrix with a positive first element

I have a table of order $30 \times 3$. I want to pick a row from this table which is first to have its first element to be positive, irrespective of the values of the rest two elements.

For example, if

T = {{-2, 1, 2}, {-4, 2, 5}, {-6, 4, 3}, {-2, 2, 1}, {2, 4, 4}, {1, 5, 3}}

How can I tell Mathematica to pick the row {2, 4, 4} from the T.

Routine clean-up
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Loading
Source Link
user49535
  • 1.2k
  • 6
  • 11
Loading