| Author |
Comment/Response |
Mikel
|
06/27/06 10:59pm
Hi
I have several issues
I am constructing a set of ordered pairs with Table:
Table[{i,j},{i,6},{j,6}]. I want something like {{1,1},{1,2},...,{6,6}} but Mathematica outputs {{{1,1},{1,2},...,{6,6}}}, that is, it gives a nested list. How do I get output I want?
I also want to extract the pairs such that the first component is greater that the second, I tried using Cases[S,crit], where S=Table[{i,j},{i,6},{j,6}] and crit[l_List]:=If[l[[1]][[1]]>l[[1]][[2]],True,False], but Mathematica gives an error. What's wrong with this criteria?
In general, where can I find a tutorial on working with patterns within lists?
Thanks
URL: , |
|