| Author |
Comment/Response |
Kim Chris
|
07/23/12 2:16pm
I need to output a list of {i,j} where i is held constant while j loops from 1 to n, then i is increased by 1 and the process is repeated. The list should look like {{1,1}, {1,2},...{1,n}, {2,1}, {2,2}}, and so on until {n,n}.
I have tried using Table[{i, j}, {i, 1, 20}, {j, 1, 20}], but this outputs with dimensions {20,20,2}. I need a list of 400 elements in a row, not 20 lists of 20 elements.
I also briefly tried using For, but I have no experience with this and couldn't output a list.
Any help would be greatly appreciated.
Thanks,
URL: , |
|