RE: Kronecker product of matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg18509] RE: [mg18429] Kronecker product of matrices
- From: "Roddy Rivas-Llosa M." <rhoworks at my-deja.com>
- Date: Thu, 8 Jul 1999 22:32:50 -0400
- Organization: Deja.com - Share what you know. Learn what you don't.
- References: <7m15ln$po0@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
> 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.