如何在 MATLAB 中求解行列式?
举一个简单的例子,假设您有这个矩阵:
M = [omega 1;
2 omega];
并且您需要求解满足条件 det M = 0
的 omega
值。 在 MATLAB 中如何做到这一点?
这确实很简单,但我还没有找到这个功能。
As a simple example, let's say you have this matrix:
M = [omega 1;
2 omega];
and you need to solve for the values of omega
that satisfy the condition det M = 0
.
How do you do this in MATLAB?
It is surely something simple, but I haven't found the function yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于矩阵可以是任何东西的一般情况,您需要创建矩阵的符号表示,计算行列式,并求解感兴趣的变量。您可以分别使用函数 SYM 来完成此操作、DET 和 SOLVE 来自 符号数学工具箱:
创建初始矩阵
A
也有不同的方法。上面,我用一个字符串表达式完成了它。但是,我可以使用 SYMS 来定义w
作为符号变量,然后像在 MATLAB 中通常那样构造一个矩阵:现在
A
是一个符号矩阵,就像在第一个示例中一样。For the general case where your matrix could be anything, you would want to create a symbolic representation of your matrix, compute the determinant, and solve for the variable of interest. You can do this using, respectively, the functions SYM, DET, and SOLVE from the Symbolic Math Toolbox:
There are also different ways to create the initial matrix
A
. Above, I did it with one string expression. However, I could instead use SYMS to definew
as a symbolic variable, then construct a matrix as you normally would in MATLAB:and now
A
is a symbolic matrix just as it was in the first example.如果您没有符号工具箱,请使用 sympoly 工具箱,可在文件交换。
If you don't have the symbolic toolbox, then use the sympoly toolbox, found on the file exchange.
那么确定的是:
om * om - 1*2 = 0
所以你会得到: om*om = 2
正式定义是: [ab ; cd] = ad - bc
我会考虑简化确定性,并找到一个求解器来求解未知数。
Well the determinate is:
om * om - 1*2 = 0
So you would get: om*om = 2
The formal definition is: [a b ; c d] = ad - bc
I would look into simplifying the determinate, and finding a solver to solve for the unknowns.