This is last axis extension.
 
   bdiag=: [ , #&[EMAIL PROTECTED]:@[EMAIL PROTECTED] ,"1 ]
   (i.2 4) bdiag (i.3 2)
0 1 2 3 0 0
4 5 6 7 0 0
0 0 0 0 0 1
0 0 0 0 2 3
0 0 0 0 4 5
   >bdiag&.>/ (i.1 2) ; (i.2 4) ; (i.3 2)
0 1 0 0 0 0 0 0
0 0 0 1 2 3 0 0
0 0 4 5 6 7 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 2 3
0 0 0 0 0 0 4 5


----- Original Message ----
From: Henry Rich <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Thursday, June 22, 2006 3:25:30 PM
Subject: RE: [Jprogramming] Block-Diagonal Matrices


For 2 matrices,

M1 ((+&# {. [) ,. ([EMAIL PROTECTED]&# {. ])) M2

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Leigh 
> J. Halliwell
> Sent: Thursday, June 22, 2006 2:33 PM
> To: [email protected]
> Subject: [Jprogramming] Block-Diagonal Matrices
> 
> Dear J Forum:
> I have two matrices M1 and M2.  How do I create a matrix that is
> block-diagonal in them (zero elsewhere)?  Thanks.
> Sincerely,
> Leigh
>  
> 

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to