Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Change language to: Français - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.0.2. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Linear Algebra > Matrix Pencil > companion

# companion

companion matrix

### Calling Sequence

`A=companion(p)`

### Arguments

p

polynomial or vector of polynomials

A

square matrix

### Description

Returns a matrix `A` with characteristic polynomial equal to `p` if `p` is monic. If `p` is not monic the characteristic polynomial of `A` is equal to `p/c` where `c` is the coefficient of largest degree in `p`.

If `p` is a vector of monic polynomials, `A` is block diagonal, and the characteristic polynomial of the ith block is `p(i)`.

### Examples

```s=poly(0,'s');
p=poly([1,2,3,4,1],'s','c')
det(s*eye()-companion(p))
roots(p)
spec(companion(p))```

• spec — eigenvalues of matrices and pencils
• poly — polynomial definition
• randpencil — random pencil