首页 > 解决方案 > 如何在给定 3x3 矩阵的 matlab 中找到稳态向量

问题描述

我得到一个 3x3 矩阵 [0.4, 0.1, 0.2; 0.3, 0.7。0.7; 0.3, 0.2, 0.1]。问题是找到稳态向量。但是,我应该使用 Matlab 来解决它,但我无法获得正确的答案。我们应该使用公式 A(xI)=0。我可以手动解决它,但我不知道如何将它输入到 Matlab 中。任何帮助是极大的赞赏。

标签: matlabmatrix

解决方案


我假设你的意思是x(A-I)=0因为你写的东西对我来说真的没有意义。我写的方程式暗示了x*A^n=x这通常是稳态的意思。方程的解是 的左特征向量,A特征值为1

可以得到A使用eig函数的特征向量和特征值。

A = [0.4, 0.1, 0.2; 0.3, 0.7, 0.7; 0.3, 0.2, 0.1];
% Get the eigenvalues (D) and left eigenvectors (W)
[~,D,W] = eig(A);
% Get the index of the eigenvalue closest to 1
[~,idx] = min(abs(diag(D)-1));
% Get associated eigenvector
x = W(:,idx).';

检查解决方案

>> all(abs(x*(A-eye(size(A)))) < 1e-10)
ans =
   logical
    1

推荐阅读