Question: only question 1&3 2 is not important please solve 1 and 3 to rate I. The f (x) = ex function can be expressed in

only question 1&3
2 is not important please solve 1 and 3 to rate
I. The f (x) = ex function can be expressed in a Taylor series by 2! 3! n! Write a user-defined function y - Tavloz Exp(x) that determines the function by using the Taylor series representation. The input of the function is the value of the x and the output is the approximation of e at the given x. The user defined-function calculates the Taylor series hy adding terms of the series. If an is the nth term in the series, then the sum Sn of the n terms is SnSn-1 tan In each pass, the code calculates the estimated error E given by E script file callet TalexE to call TavlerExp and runs it. Run your code to evaluate e-2, e2, e3, e Sn- Sn-1 Sn-i and stop ading and stop adding terms when E 0.000001. Then write a 2. The factorial of a positive integer number is defined by n! n (n-1) (n-2)... (3) (2) (1), where 0!1. Write a user-defined function that calculates the factorial n! For function name and arguments, use yfact (x), where the input argument x is the given number and v is the value ofxl Write a script Caller fact.m which asks the user for the number. If the number is negative or non-integer, the error message should be displayed. Otherwise the fact will be called and the factorial of the given number will be calculated and displayed. Do not use MATLAB built-in function factorial0. Use fact with the following numbers a) 9! c) 0! d) -5! Hint: A number is non-integer when: floor(x)--x 3. The geometric mean GM of a set of n positive numbers x1, x2, ..., xn is defined by: GM= (x1 x2 m )1 Write a user-defined function that calculates the geometric mean of a set of numbers. The geometric mean is useful for calculating the average of rates. Thefollowing table gives the inflation rates in the US from 1978 to 1987 (inflation of 7.6% means 1.076). Use your user-defined function to calculate the average inflation for the ten year period ear 1978 19791980 1981 1982 1983 1984 1985 19861987 Inflation1.07611131135 1.103 1.062 1.03 1.043 1.036 1.019 1.036 rate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
