1a): Find the roots of the following polynomial equations using matlab:
f(x) = x^5 − 9x^4 + 31x^3 − 51x^2 + 40x − 12
f(x) = x^5 − 11x^4 + 47x^3 − 97x^2 + 96x − 36
b): Find the coefficients of two polynomial equations in matlab given the following sets of roots:
r1 = [ 100 25 50 5 10 ] r2 = [ 11 22 33 0 55 ]
c): Create a figure with four subplots, each showing a plot of one of the above functions as a line. Plot in an appropriate range to show the roots. Plot the locations of the roots as points on each subplot. Include axes labels, a legend that displays each function.
clear
clc
%1a
p1=[1 -9 31 -51 40 -12];
r1=roots(p1);
fprintf('Roots of x^5 - 9x^4 + 31x^3 - 51x^2 + 40x - 12:\n')
disp(r1)
p2=[1 -11 +47 -97 96 -36];
r2=roots(p2);
fprintf('Roots of x^5 - 11x^4 + 47x^3 - 97x^2 + 96x - 36:
\n')
disp(r2)
%1b
r3=[100 25 50 5 10];
p3=poly(r3);
fprintf('Coefficients of polynomial whose roots are [ 100 25 50 5
10 ] :')
disp(p3)
r4=[11 22 33 0 55];
p4=poly(r4);
fprintf('Coefficients of polynomial whose roots are [ 11 22 33 0 55
] :')
disp(p4);
%1c
subplot(2,2,1)
x=(min(r1)-2):.01:(max(r1)+2);
plot(x,polyval(p1,x),r1,polyval(p1,r1),'k*')
legend('x^5 - 9x^4 + 31x^3 - 51x^2 + 40x - 12','roots')
xlabel('x')
ylabel('y')
grid on
subplot(2,2,2)
x=(min(r2)-2):.01:(max(r2)+2);
plot(x,polyval(p2,x),r2,polyval(p2,r2),'k*')
legend('x^5 - 11x^4 + 47x^3 - 97x^2 + 96x - 36','roots')
xlabel('x')
ylabel('y')
grid on
subplot(2,2,3)
x=(min(r3)-2):.01:(max(r3)+2);
plot(x,polyval(p3,x),r3,polyval(p3,r3),'k*')
legend(sprintf('(%d)x^5 + (%d)x^4 + (%d)x^3 + (%d)x^2 + (%d)x +
(%d)',p3),'roots')
xlabel('x')
ylabel('y')
grid on
subplot(2,2,4)
x=(min(r4)-5):.01:(max(r4)+5);
plot(x,polyval(p4,x),r4,polyval(p4,r4),'k*')
legend(sprintf('(%d)x^5 + (%d)x^4 + (%d)x^3 + (%d)x^2 + (%d)x +
(%d)',p4),'roots')
xlabel('x')
ylabel('y')
grid on
1a): Find the roots of the following polynomial equations using matlab: f(x) = x^5 − 9x^4...
Consider the function f(x) 1 25x which is used to test various interpolation methods. For the remainder of this problem consider only the interval [-1, 1] The x-values for the knots (or base-points) of the interpolation algorithm are located at x--1,-0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75 1. (a) Create a "single" figure in Matlab that contains 6 subplots (2x3) and is labelled as figure (777), i.e the figure number is 777. Plot in each subplot the function f(x) using...
Please MATLAB for all coding with good commenting. (20) Consider the function f(x) = e* - 3x. Using only and exactly the four points on the graph off with x-coordinates -1,0, 1 and 2, use MATLAB's polyfit function to determine a 3' degree polynomial that approximates f on the interval (-1, 2]. Plot the function f(x) and the 360 degree polynomial you have determined on the same set of axes. f must be blue and have a dashed line style,...
1) Using Matlab, find all real and complex roots of the following polynomial equation: (x-1)(x-2)(x-3)(x-4)(x-5)(x-6)(x-7)=8 2) Using Matlab, find the root for the following system of equations. Both x and y are positive. a: (x^2)cos(y)=1 b: e^(-4x)+1
Solve the following equations graphically and numerically using roots function on matlab a) x ^ 5 - 3x ^ 3 + 2x ^ 2 - 1 = 0 b) exp(exp(-x)) -5 x^2=0
Need these done on matlab 4. (10%) Given the roots (.--2, x-3.x-8), reconstruct the corresponding polynomial 5. (10%) Add the following polynomials: f(x)- x3-x +3 g(x) x2-8 h(x)-x*+2 6. (10%) Multiply the polynomials from Problem 5.
Function driver and script file please 4) The polynomial f (x)-0.0074x*-0.284x3+ 3.355x2 12.183x +5 has a real root between 15 and 20. Apply the Newton-Raphson method to this function using an initial guess of xo-16.15. Explain your results. 5) Use the roots MATLAB function to find the roots of the polynomial x x-1-0. Compare your answer to the answer you derived in in question 1. 6) Write the following set of equations below in matrix form. Use MATLAB to solve...
Use MatLab. Using f(x) = x^5 - 9x^4 - x^3 + 17x^2 - 8x -8 and x0 = 0, study and explain the behavior of Newton's method. Hint: The iterates are initially cyclic
6) Use MATLAB and Newton-Raphson method to find the roots of the function, f(x) = x-exp (0.5x) and define the function as well as its derivative like so, fa@(x)x^2-exp(.5%), f primea@(x) 2*x-.5*x"exp(.5%) For each iteration, keep the x values and use 3 initial values between -10 & 10 to find more than one root. Plot each function for x with respect to the iteration #.
Problem 1 MATLAB A Taylor series is a series expansion of a function f()about a given point a. For one-dimensional real-valued functions, the general formula for a Taylor series is given as ia) (a) (z- a) (z- a)2 + £(a (r- a) + + -a + f(x)(a) (1) A special case of the Taylor series (known as the Maclaurin series) exists when a- 0. The Maclaurin series expansions for four commonly used functions in science and engineering are: sin(x) (-1)"...
The Taylor polynomial approximation pn (r) for f(x) = sin(x) around x,-0 is given as follows: TL 2k 1)! Write a MATLAB function taylor sin.m to approximate the sine function. The function should have the following header: function [p] = taylor-sin(x, n) where x is the input vector, scalar n indicates the order of the Taylor polynomials, and output vector p has the values of the polynomial. Remember to give the function a description and call format. in your script,...