I have a list of lists from which I would like to pick out the positions of the number 1
and then print out these positions for each sublist.
I am having some trouble collecting what I am printing into a list / matrix / array though. Below is my list of lists and the commands by which I find the positions of the 1's and print them out. Thanks.
ZeroCrossings = {{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1,
0, 0, 1, 0, 0, 0, 1, 1, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
0}, {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0}, {0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 1, 1, 0}, {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0}}
Do[Print[Flatten[Transpose[Position[ZeroCrossings[[t]], 1]]]], {t, 1,Length[ZeroCrossings]}]
{3,9}
{4,5,8,12,13}
{4,12,13}
{4,8,11,13}
{4,9,12,13}
{5,6,11}
Print
and changeDo
toTable
. Is this what you need? $\endgroup$