Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.1.0 - 日本語


companion

companion matrix

Syntax

A=companion(p)

Arguments

p

double or polynomial vector

A

square matrix

Description

A = companion(p) with p which is a vector of polynomial coefficients returns the companion matrix. The coefficients must be in order of decreasing degree.

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

Companion matrix created from a polynom

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

Companion matrix created from vector of polynomial coefficients

// p = x4 + 4x3 + 3x2 + 2x + 1
c = [1 4 3 2 1];
companion(c)

See also

  • spec — 行列とペンシルの固有値
  • poly — Polynomial definition from given roots or coefficients, or characteristic to a square matrix.
  • randpencil — ランダムなペンシル

History

バージョン記述
2025.1.0 companion now accepts a vector of polynomial coefficients.
Report an issue
<< blockdiag elementarymatrices diag >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 22 12:57:08 CEST 2025