Question: MATLAB question: Given the function f(x) below, use for loops and if statements to perform the following exercises. f(x) = cos(1.2x)exp[-(x/8)^4] (a. b) Compute f(x)
MATLAB question:

Given the function f(x) below, use for loops and if statements to perform the following exercises. f(x) = cos(1.2x)exp[-(x/8)^4] (a. b) Compute f(x) for x = [-20:0.1:20]. Put x into pla and f into plb. (c - e) How many local maxima does f(x) have (excluding the end values of f)? Put the answer in plc. Find the x values and f values of the maxima and put the answers in pld and ple. respectively. List the maxima in the order of increasing x. (f - h) How many local minima does f(x) have (excluding the end values of f)? Put the answer in plf. Find the x values and f values of the minima and put the answers in plg and plh. respectively. List the minima in the order of increasing x. (i - k) How many times does f(x) cross zero value? Put the answer in pli. Find the x values and f values right before f(x) crosses zero value and put the answers in plj and plk. respectively. List the zero crossing in the order of increasing x. (1) Make figure 1 to include a solid line for f(x) and different symbols for the maxima, the minima and the zero crossing. Label the axes and give title and legend. Set p1l='See figure 1'. Make sure that the figure is plotted on screen when your homework script is executed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
