Skip to main content
more concise matrix (thanks march)
Source Link
J_Nat
  • 346
  • 1
  • 12

If all of the columns are part of one table, try

matrix = Table[RandomInteger[RandomInteger[{0, 1}], {i, 8}, {j, 3}];

For[i = 1, i <= Length[matrix], i++, 
    If[matrix[[i, 1]] == 0 && matrix[[i, 3]] == 1, Print[i]]];

If all of the columns are part of one table, try

matrix = Table[RandomInteger[{0, 1}], {i, 8}, {j, 3}];

For[i = 1, i <= Length[matrix], i++, 
    If[matrix[[i, 1]] == 0 && matrix[[i, 3]] == 1, Print[i]]];

If all of the columns are part of one table, try

matrix = RandomInteger[{0, 1}, {8, 3}];

For[i = 1, i <= Length[matrix], i++, 
    If[matrix[[i, 1]] == 0 && matrix[[i, 3]] == 1, Print[i]]];
Source Link
J_Nat
  • 346
  • 1
  • 12

If all of the columns are part of one table, try

matrix = Table[RandomInteger[{0, 1}], {i, 8}, {j, 3}];

For[i = 1, i <= Length[matrix], i++, 
    If[matrix[[i, 1]] == 0 && matrix[[i, 3]] == 1, Print[i]]];