       Re: Product command with matrices

• To: mathgroup at smc.vnet.net
• Subject: [mg87874] Re: [mg87834] Product command with matrices
• From: "W_Craig Carter" <ccarter at mit.edu>
• Date: Sat, 19 Apr 2008 03:33:46 -0400 (EDT)
• References: <200804180640.CAA12618@smc.vnet.net>

```Hello J,
You should  use Dot.

Perhaps this will help:
f[i_ ] := f[i] = RandomReal[{0, 1}, {2, 2}] (* random 2x2 matrices,
that remember their value*)

f.f.f
Dot[f, f, f]
Apply[Dot, {f, f, f}]

So, what you want is something like
Apply[Dot,Table[matrices[k],{k,1,n}]

On Fri, Apr 18, 2008 at 2:40 AM, J Davis <texasAUtiger at gmail.com> wrote:
> I want to define a matrix valued function such as the following (in
>  LaTeX lingo):
>
>  \$\$
>  X(0)=Id,
>  X(n)=\prod_{i=0}^{n-1} (Id + f[i] A)
>  \$\$
>
>  where A and f have already been defined and Id is the identity matrix
>  of appropriate size.
>
>  I tried the following:
>
>  Id=IdentityMatrix;
>  Phi:=Id;
>  Phi[n_]:= Product[Id + f[i] A,{i,0,n-1}]
>
>  However, Phi and (Id+fA).(Id+fA).(Id+fA) do not agree.
>
>  Any help around this would be appreciated.
>
>

--
W. Craig Carter

```

• Prev by Date: Re: NDSolve and vector functions
• Next by Date: Re: Indefinite numbers of arguments in a function
• Previous by thread: Re: Product command with matrices
• Next by thread: Re: Product command with matrices