Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Generating a matrix from an equation' topicStudent Support Forum > General > "Generating a matrix from an equation"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
09/23/00 10:55am

>If {theta} is a 3 component vector, how do you generate a 3 x 3 matrix [B], such that B(i,j) = theta(i)*theta(j), where i,j =1,2,3?

=======

Use Table:


In[9]:= theta = {a[1], a[2], a[3]};

In[10]:= B = Table[theta[[i]]*theta[[j]], {i, 1, 3}, {j, 1, 3}]
Out[10]= {{a[1]^2, a[1]*a[2], a[1]*a[3]}, {a[1]*a[2], a[2]^2,
a[2]*a[3]}, {a[1]*a[3], a[2]*a[3], a[3]^2}}

Tom Zeller
Forum Moderator


URL: ,

Subject (listing for 'Generating a matrix from an equation')
Author Date Posted
Generating a matrix from an equation Rick Hladik 09/23/00 10:52am
Re: Generating a matrix from an equation Forum Modera... 09/23/00 10:55am
< Previous CommentHelp | Reply To Comment | Reply To Topic