New answers tagged

1 vote

Nonzero element positions of a matrix

Using Position, Condition and Table: ...
E. Chan-López's user avatar
2 votes

Nonzero element positions of a matrix

Using SequencePosition: First /@ SequencePosition[#, {Except[0]}] & /@ m {{1, 2}, {1, 3}}
Syed's user avatar
  • 38.2k
2 votes

Nonzero element positions of a matrix

m = {{1, 2, 0}, {4, 0, 9}}; Flatten @* Values @* KeyDrop[0] @* PositionIndex /@ m {1, 2}, {1, 3}}
eldo's user avatar
  • 41k

Top 50 recent answers are included