block version of diag function

John W. Eaton jwe at bevo.che.wisc.edu
Thu Mar 6 11:47:30 CST 2008


On  6-Mar-2008, Kamaraju S Kusumanchi wrote:

| 2) Is there any way to assemble a set of blocks along the diagonals of a
| bigger matrix.
| 
| For example if the inputs are
| 
| 1 2
| 5 6
| 
| and
| 
| 11 12
| 15 16
| 
| I would like to assemble these matrices along the diagonal and get
| 
|  1  2  0  0
|  5  6  0  0
|  0  0 11 12
|  0  0 15 16

Try

  help blkdiag

jwe


More information about the Help-octave mailing list