フィルターのクリア

How to convert a symbolic matrix into matrix polynomial

6 ビュー (過去 30 日間)
Isaac
Isaac 2023 年 7 月 27 日
コメント済み: Isaac 2023 年 7 月 27 日
I have a matrix with its elements as polynomials, such as the following N matrix. I was wondering whether it would be possible to convert it into a matrix polynomial expression like N0 + N1*x + N2*x^2? My idea is to retrieve the matrices N0, N1, N2. I would deeply appreciate any pointers regarding this. Thank you.
syms x
N = [1 5-3*x 0;0 1 5-3*x;1 0 x^2-5];
  2 件のコメント
Walter Roberson
Walter Roberson 2023 年 7 月 27 日
Is x intended to be scalar or matrix itself?
Isaac
Isaac 2023 年 7 月 27 日
x is a symbolic variable. So it is indeed a scalar.

サインインしてコメントする。

回答 (1 件)

VBBV
VBBV 2023 年 7 月 27 日
編集済み: VBBV 2023 年 7 月 27 日
syms x
N = [1 5-3*x 0;0 1 5-3*x;1 0 x^2-5]
N = 
K = poly2sym(N,[x])
K = 
simplify(K)
ans = 
  2 件のコメント
VBBV
VBBV 2023 年 7 月 27 日
use poly2sym for converting to symbolic polynomial expressions
Isaac
Isaac 2023 年 7 月 27 日
Thank you for the reply, I suppose I have poorely worded my question. My intention was to decompse the N matrix into the following N0, N1, N2 matrices, such that N = N0 + N1*x + N2*x^2;
N0 = [1 5 0;0 1 5;1 0 -5]; N1 = [0 -3 0;0 0 -3;0 0 0]; N2 = [0 0 0;0 0 0;0 0 1];

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by