ADVANCED TECHNICAL ANALYSIS 17,19,21 5-16, A linear domain -3 sxs3. equalloll an
ID: 3796980 • Letter: A
Question
ADVANCED TECHNICAL ANALYSIS 17,19,21 5-16, A linear domain -3 sxs3. equalloll and plot it over the 5-17 Determine the roots of the equation y +1.2529x +1.5349x+0.7157 5.18. Determine the roots of the equation +2x +2x +1 519, Reconstruct the polynomial in Problem 5-17 from the roots. 5.20. Reconstruct the polynomial in Example 5-18 from the roots. 21 For the polynomial of Problems 5-17 and 5-19, evaluate the function for x 0,0 l, and 2. 5-22. For the polynomial of Problems 5-18 and 5-20, evaluate the function for x 0,05 1, and 2. 5-23. Determine the roots of the equExplanation / Answer
Below is the MATLAB code for questions asked.
First we put the co-efficents of the polynomial in a vector called 'actual' and then use the function roots() to evaluate the roots . These roots are stored in 'r'. This answers question 5-17. Next to reconstruct the polynomial from roots , we use the function poly( ) which returns the co-efficients of the polynomial as a vector. This result is stored in 'reconstructed'. This answers question 5-19. Next to evaluate the roots for the given values of x, we store those values as a vector in 'x'. Function polyval( ) is useful to evaluate a polynomial given its co-efficients and the values at which you need to evaluate the polynomial . General format of calling polyval( ) function is polyval(<coefficient vector>, <x values>). So this is done and results stored in y1 for actual equation and y2 for reconstructed equation and the results are displayed. We observe both y1 and y2 match.
==========================
actual=[1 1.2529 1.5349 0.7157]; % co-efficients of the equation for y
r=roots(actual); %find the roots using the co-efficients
disp('The roots of the equation are ')
disp(r)
reconstructed=poly(r); %reconstruct the polynomial from roots
%we get the coefficients of the polynomial
disp('The co-efficients for reconstructed polynomial from roots are ')
disp(reconstructed)
x=[0 0.5 1 2] %values for x for which we want to evaluate y
y1=polyval(actual,x);
disp('The values of y for original polynomial for above x values');
disp(y1);
y2=polyval(reconstructed,x);
disp('The values of y for reconstructed polynomial for above x values');
disp(y2);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.