Question: (1) Write a Matlab m-function with the file name FunCombination.m that computes the combination af (2) + bg(x). The inputs to your m-function are the

 (1) Write a Matlab m-function with the file name FunCombination.m that

(1) Write a Matlab m-function with the file name FunCombination.m that computes the combination af (2) + bg(x). The inputs to your m-function are the two numbers a and b, the two function handles f and g, and the vector x containing the values of x. The output is the vector c containing the values of af(x) + bg(2) at the values of x. (2) Write another Matlab m-function myf.m to implement the mathematical function f(x) = cos(1.1.x). (3) Write a Matlab m-script to test your m-functions. In your m-script, you define a mathematical function g(x) = cos(1.3x) as an anonymous function with the function name myg and a vector x with 2001 equally spaced values from -107 and 107. You then call the m-function FunCombination to combine f(x) and g(2) with a = 4 and b = 5, and plot the graph of your combined function returned from the m-function FunCombination in Figure 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!