Exact value of a result

조회 수: 9 (최근 30일)
Marc-Samuel
Marc-Samuel 2022년 11월 29일
답변: Walter Roberson 2022년 11월 29일
Hello, I am trying to get the exact values of the following lines :
b=[-1, 3];
a=[1, -3, -2];
[r,p,k]=residuez(b,a);
right now, I obtain something like : p=[3.5615;-0.5615] and r=[-0.1361;-0.8638] and k=1.
Is there a format that would allow me to get me to see it displayed like : p=[(3-sqrt(17))/2 ; (3+sqrt(17))/2] and same for r?
thanks

답변 (2개)

David Hill
David Hill 2022년 11월 29일
residuez requires doubles as input, but p is just the roots of polynomial a which you could use symbolic to produce.
a=sym([1, -3, -2]);
p=roots(a)
p = 

Walter Roberson
Walter Roberson 2022년 11월 29일
No, the calculations are inherently carried out in floating point.
If you were to follow along in the source code you could strip out the checks for floating point, and you could convert the numeric roots() call to use poly2sym() and then solve for symbolic roots. But after that the code uses filter() to run an impulse through, and emulating that symbolically might take a bit of work.

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by