Question: / ( ng f(x) = x2-sin(x)+2 (a)Provide the code to create the function fo: (b) Record the results: f(0)-f (c) Provide the code to vectorize
/ ( ng f(x) = x2-sin(x)+2 (a)Provide the code to create the function fo: (b) Record the results: f(0)-f (c) Provide the code to vectorize the function f (1) lel create x linspace (-1,1), evaluate fikd, and plot x vs fity. However, you do not need to tn combine the folowi the coans ito a single command to produsce the plot that you wille at the answer. end of the third command. linspace (-1,1); y f(x)i plot (x,y) i x= Provide the code for the requested single command: (g) Provide the code to generate the graph f(x) over x from-r to using f plot. (2) Create three anonymous functions corresponding to the following expressions: f(x) =x4-8x3 + 17x2-4x-20 g(x)-x2-4x + 4 h(x) =x2-4x-5 (a)Evaluate fix)-gix)htx) at x-3 (b)Evaluate fix-gtx)hx) at xe 12345] (c) Evaluate fix)/glx)-h(x) for x 8 (d) Plot fix) and fix/(gtx)h(x) over x el-5,5]. However, this does not need to be turned in. 3) The formula for computing compound interest on an investment is given byx(1 l interest in percentage, and n-number where x = accumulated amount, xo = initial investment, r rate of annua of years. (a)Provide the MATLAB code to define an anonymous function to compute x with (xor,n) as the input. (b)Using this function, compare the growth of a $1000 investment over a period of 8 years earning an interest of 9% with that over a period of 9 years earning an interest of 8%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
