What does roots/ eig do exactly?

조회 수: 14 (최근 30일)
Thomas Waljor
Thomas Waljor 2015년 8월 5일
댓글: James Tursa 2015년 8월 5일
I want to write a programm on Matlab, without using implemented functions. This programm should be similiar to the Matlab function roots. But I am not sure what roots does, is there any possibility to read something like a pseudo-code of roots or eig? Or is it possible to find .m file that fullfills this conditions?
Is roots simply using the QR decomposition with shifts ?

채택된 답변

Sean de Wolski
Sean de Wolski 2015년 8월 5일
편집: Sean de Wolski 2015년 8월 5일
  댓글 수: 7
Thomas Waljor
Thomas Waljor 2015년 8월 5일
For my bachelor thesis I wrote a programm that computes the roots of a polynomial quiet fast. One part of mine assignment is to compare this algorithm with the in Matlab implemented roots function. It is impossible to compare them directly, since I had to use Matlab to programm the first algorithm. Right now I try to figure out how roots computes the roots of a polynomial.
James Tursa
James Tursa 2015년 8월 5일
By looking at the code for roots you have that answer. It constructs a matrix where the characteristic polynomial of that matrix is your polynomial. Then it uses eig to find eigenvalues of that matrix, which will be equal to the roots of the characteristic polynomial.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by