MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Kronecker product of matrices


> Kostas Oikonomou  wrote:
>
> Is there a simple way to make Outer[Times,A,B] produce the Kronecker
> product of A and B?  What I mean is that if A is nxn and B mxm, Outer
> produces a block form, instead of a plain (mn)x(mn) matrix.
>

I had the same problem a couple of months ago and developed the
following function. I hope you find it useful.

kronecker[m1_,m2_]:=
  Partition[
    Join[Flatten[
        Table[Flatten[Transpose[Outer[Times,m1[[i]],m2]]],{i,1,
            Dimensions[m1][[1]]}]]],4]

--
Roddy Rivas-Llosa M., MBA
Professor of Economics, Finance and
Computing Science.
Universidad del Pacifico - Lima-Peru


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


  • Prev by Date: Re: send notebook expression by Email
  • Next by Date: Re: how decrease computation time?
  • Previous by thread: Re: Kronecker product of matrices
  • Next by thread: Re: Kronecker product of matrices