How to solve determinants in MATLAB?

As a simple example, suppose you have this matrix:

M = [omega 1;
     2     omega];

and you need to decide for values omegathat satisfy the condition det M = 0. How do you do this in MATLAB?

This is certainly something simple, but I haven't found a function yet.

+3
source share
3 answers

, , , . , , , SYM, DET SOLVE Symbolic Math Toolbox:

>> A = sym('[w 1; 2 w]');  % Create symbolic matrix
>> solve(det(A),'w')       % Solve the equation 'det(A) = 0' for 'w'

ans =

  2^(1/2)
 -2^(1/2)

>> double(ans)             % Convert the symbolic expression to a double

ans =

    1.4142
   -1.4142

A. . SYMS, w , , MATLAB:

syms w
A = [w 1; 2 w];

A , .

+13

, sympoly, .

sympoly omega
roots(det([omega 1;2 omega]))
ans =
      -1.4142
       1.4142
+2

Well, determinate: om * om - 1 * 2 = 0

So you get: om * om = 2

Formal definition: [ab; cd] = ad - bc

I would like to study the simplification of a deterministic solution and find a solver for the unknown.

0
source

Source: https://habr.com/ru/post/1722486/


All Articles