Matlab finds Smith standard form of matrix

Use the smithForm function


example

% simplify函数用于化简表达式
>> syms x
>> y = x^2+2*x+1;
>> simplify(y)

%{

ans =
 
(x + 1)^2

%}

% 矩阵A

>> A=[x+1 2 -6;1 x -3;1 1 x-4]

%{

A =
 
[x + 1, 2,    -6]
[    1, x,    -3]
[    1, 1, x - 4]

%}

% 求矩阵A的Smith标准形
>> simplify(smithForm(A))

%{

ans =
 
[1,     0,         0]
[0, x - 1,         0]
[0,     0, (x - 1)^2]

%}

Guess you like

Origin blog.csdn.net/weixin_46566663/article/details/127778769