Question: In MATLAB Function Splicer Your task is to write a program of the form function [hl,h2] - functionSplicer (f,g,x0,p) that takes two functions f and
In MATLAB
Function Splicer Your task is to write a program of the form function [hl,h2] - functionSplicer (f,g,x0,p) that takes two functions f and g and a point ro and returns the functions f(x,p) x x0 h(x) = and h2(x) max(f(x, p), g(x)} It should have the following properties: 1. If to is not provided (see nargin), then it uses the default value ro0 2. If p is not provided, then the program just uses f()nstead of f(x,p). 3. The definition for h2(x) should be an anonymous function and take just one line Make a Plot In a separate Matlab file, you should use functionSplicer to make plots of hi and h2 given the functions f(x)-cos(30x) (in degrees), g(x) = e", and 20 =-1. Plot them on the domain [-5, 1] and turn in a copy of the plot along with your code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
