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.
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 definewas a symbolic variable, then construct a matrix as you normally would in MATLAB:and now
Ais a symbolic matrix just as it was in the first example.