Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語 - Русский
Aide de Scilab >> Fonctions Elémentaires > Traitement du signal > sysdiag


Create a block diagonal matrix from provided inputs or block diagonal system connection




Returns the block-diagonal system made with subsystems put in the main diagonal


subsystems (i.e. gains, or linear systems in state-space or transfer form)

constant, boolean, polynomial or rational matrices of any size


a matrix with a1, a2, a3, ... on the diagonal


Given the inputs A, B and C, the output will have these matrices arranged on the diagonal: .

If all the input matrices are square, the output is known as a block diagonal matrix.

Used in particular for system interconnections.

Beside this function, you can also use sparse() primitive to build a block diagonal sparse matrix.

For boolean matrices sysdiag() always returns a zero one matrix in the corresponding block ("true" values are replaced by 1 and "false" value by 0).

sysdiag() cannot be used to arrange matrices made of character strings, but you can overload it (see: overloading).


At most 17 arguments.


// a matrix of doubles:
A=[1 0; 0 1], B=[3 4 5; 6 7 8], C=7
sysdiag([%t %f; %f %t], eye(2,2), ones(3,3))
// a polynomial matrix:
sysdiag([s 4*s; 4 s^4], [1 s^2 s+2; 3*s 2 s^2-1])
// a rational matrix:
sysdiag([1/s 2*s/(4*s+3)], [s; 4; 1/(s^2+2*s+1)])
// a block diagonal sparse matrix:
S=sysdiag([1 2; 3 4], [5 6; 7 8], [9 10; 11 12], [13 14; 15 16])

See also

  • brackets — Concaténation. Récipients d'une affectation. Résultats d'une function
  • insertion — insertion/modification dans une variable
  • feedback — feedback operation
  • diag — extraction de diagonale ou construction d'une matrice avec un vecteur en diagonal
  • bdiag — bloc-diagonalisation, vecteurs propres généralisés
  • sparse — sparse matrix definition
  • repmat — Définit un grand tableau par pavage avec un tableau 2D.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 14:59:54 CET 2019