0
|
4461 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

# help with this problem, I need generate a list with the function table

Posted 10 years ago
 I need generate the next list with the function table: {1,-1,1,-1,1,-1,1,-1,1,-1}, {-1,1,-1,1,-1,1,-1,1,-1}, {1.-1,-1,1,-1,1,-1}, {-1,1,-1,1,-1,1,-1}, {1,-1,1,-1,1,-1}, {-1,1,-1,1,-1}, {1,-1,1,-1}, {-1,1,-1}, {1,-1}, {-1}  I think use Table with j and i but use a potency par and odd with the number 1 for example: Table[j^2, {j, -1, 1}, {j, 1}]  but with the previous function generate only {1},{1},{1} please help me thank you
1 Reply
Sort By:
Posted 10 years ago
 There may be a more clever way to do this, but . . . In[1]:= Table[Table[(-1)^n, {n, m, 1, -1}], {m, 10, 1, -1}] Out[1]= {{1, -1, 1, -1, 1, -1, 1, -1, 1, -1}, {-1, 1, -1, 1, -1, 1, -1, 1, -1}, {1, -1, 1, -1, 1, -1, 1, -1}, {-1, 1, -1, 1, -1, 1, -1}, {1, -1, 1, -1, 1, -1}, {-1, 1, -1, 1, -1}, {1, -1, 1, -1}, {-1, 1, -1}, {1, -1}, {-1}} 
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments