Message Boards Message Boards

0
|
2938 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Iterate over subscripts, build matrix

Posted 10 years ago

Table[M(i j) , {i, 0, 1},{j, 0, 1} ] I am trying to iterate over i and j, and am not getting the desired result i.e. {{M{00}},{M{01}}, {M{10}, M_{11}}}

POSTED BY: White Sky
4 Replies

Reverse order of i and j: {j,0,1},{i,0,1}. Does this give you what you want?

POSTED BY: S M Blinder

Try either:

Table[M[i,j],{i,0,1},{j,0,1}]
Table[Subscript[M,Row[{i,j}]],{i,0,1},{j,0,1}]
POSTED BY: Sander Huisman
Posted 10 years ago

Sorry, it remains the same

POSTED BY: White Sky
Posted 10 years ago

@Sander Huisman, works awesome, Thanks !

POSTED BY: White Sky
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract