       Re: Displaying Solution in Matrix Form

• To: mathgroup at smc.vnet.net
• Subject: [mg61361] Re: Displaying Solution in Matrix Form
• From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
• Date: Mon, 17 Oct 2005 02:29:26 -0400 (EDT)
• References: <diskq0\$m9f\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```This does what you want (using a randomly generated example):

variables=Flatten[Table[f[i,j],{i,3},{j,4}]];
matrix=Table[Random[Real,{-1,1}],{12},{12}];
vector=Table[Random[Real,{-1,1}],{12}];
solution=NSolve[equations,variables]
Partition[variables,4]//TableForm
Partition[variables/.solution[],4]//TableForm

The solution is in the form of a set of replacement rules for the variables.
You use the variables /.solution construct to apply these rules to the
variables, and then use Partition to split the vector of solutions into a
matrix, which you then display using TableForm (you could use MatrixForm if
you want brackets drawn round the table).

Steve Luttrell

"mathematica newbie" <sheeba.arnold at gmail.com> wrote in message
news:diskq0\$m9f\$1 at smc.vnet.net...
> Hi,
>
> I have the 12 linear algebraic equations.
> The solutions are denoted by Fi, j's.
> F1,1 , F1,2, F1,3, F1,4,
> F2,1, F2,2  etc......through F3,4
>
> I have solved the equations with the NSolve command.
>
> How can I display this result as a 3x4 matrix, using the solution to
> assign values to the 12 Fi, j's.
>
> This must be done in a nested
> input that includes the function that solves the equations.
>
> I'm a mathematica newbie and any help with this is greatly appreciated.
> Thank you!
>

```

• Prev by Date: Re: Use strings in Mathematica, like in C?
• Next by Date: How smooth graphs?
• Previous by thread: Re: Displaying Solution in Matrix Form
• Next by thread: Re: Displaying Solution in Matrix Form