Group Abstract Group Abstract

Message Boards Message Boards

1
|
30.2K Views
|
6 Replies
|
10 Total Likes
View groups...
Share
Share this post:

About Subscript and subscripted variables

Posted 12 years ago
I have problem with instantializing a variable with subscript.
Subscript[a, i, j] = \!\(

\*UnderoverscriptBox[\(\[Product]\), \(k = i\), \(j\)]
\*SubscriptBox[\(a\), \(k\)]\);
Subscript[a, i, j] /. {i -> 1, j -> 2}
Subscript[a, 1, 2]

Why can't I instantialize ai,j by directly assigning the subscripts with 1 and 2? 
POSTED BY: Moon Liu
6 Replies
Attachments:
POSTED BY: Bruce Miller
POSTED BY: S M Blinder
Posted 11 years ago
POSTED BY: Tugrul Temel
Posted 11 years ago
POSTED BY: Kari K
Posted 11 years ago
POSTED BY: Kari K
Because there is a definition for Subscript[a, i, j] which matches only the specific symbols i and j, not the numbers 1 and 2. To have it work for any i and j, we could use Subscript[a, i_, j_]. See also this tutorial in the documentation.
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard