matlab - 如何在给定 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 中。任何帮助是极大的赞赏。
解决方案
我假设你的意思是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
推荐阅读
- java - 如何排除打包为应用程序的 uber jar 的 jar 文件
- asp.net - Post action 方法一直在浏览器中加载,服务器没有响应,但在后台运行成功?
- python - 如何在字典列表中唯一地复制字典中的值?
- javascript - 条纹内联表单和禁用的 javascript
- mysql - mysql与python的连接
- sql - 如何从不同的数据库复制或更新表索引和约束?
- angular - 使用哈希进行 OAuth 重定向后,如果下一个 http 调用失败且选项状态为 0 conn 被拒绝,Angular SPA 不会加载 svg?奇怪的边缘情况
- python - 如何在两个系统中运行两个python代码
- jenkins - 如何在詹金斯中以root身份执行命令
- gpu - 使用 pytorch 获取可用 GPU 内存的总量