문제

I have two K-by-K matrices, A and B, B is diagonal. I want to find roots of the equation :

det(Ax+B) = 0

In MATLAB. x is multiplied element by element with A. I know that det(Ax+B) is a K-order polynomial of x.

How can I find the coefficients of this polynomial? If I find these coefficients, I can find the roots of the above equation by roots() in MATLAB. If not, I should use fzero.

Best M. R.

도움이 되었습니까?

해결책 2

Seems to me the roots would just be eig(B,A).

다른 팁

You can use the Symbolic Toolbox. The following illustrates how to do it:

>> A = magic(4) %// example matrix

A =

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

>> B = diag([4 2 6 5]) %// example matrix

B =

     4     0     0     0
     0     2     0     0
     0     0     6     0
     0     0     0     5

>> syms x
>> det(A*x+B)

ans =

- 11016*x^3 + 1342*x^2 + 2568*x + 240
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top