[Index for tmp_for_tar/misc] [Return to Master Index]

bdiag

(tmp_for_tar/misc/bdiag.m)


Function Synopsis

x = bdiag(...)

Help text

 x = bdiag(m1,...)            - Forms a matrix from blocks

 INPUT:
 mi   : matrix or        : Matrices that will be put end-to-end
        list of matrices

 OUTPUT:
 x    : matrix           :      [m1 0 ..0 ]
                            x = [ 0 m2  : ]
                                [ :   . : ]
                                [ 0 ... m2]

 Note : x may be non-square and non-block diagonal if it given non-square
        matrices.

 Last modified: April 2001



Listing of function file tmp_for_tar/misc/bdiag.m

## x = bdiag(m1,...)            - Forms a matrix from blocks
##
## INPUT:
## mi   : matrix or        : Matrices that will be put end-to-end
##        list of matrices
##
## OUTPUT:
## x    : matrix           :      [m1 0 ..0 ]
##                            x = [ 0 m2  : ]
##                                [ :   . : ]
##                                [ 0 ... m2]
##
## Note : x may be non-square and non-block diagonal if it given non-square
##        matrices.

## Author:        Etienne Grossmann  <etienne@isr.ist.utl.pt>
## Last modified: April 2001

function x = bdiag(...)

				# Flatten arg list  
l0 = append (list (), all_va_args);

sz = [0,0];			# Total size
for n = 1:length (l0), sz += size (nth (l0,n)); end

x = leval ("bdiag0", append (list (sz), l0));

Produced by oct2html on Sat Apr 28 21:14:54 2001
Cross-Directory links are: ON