Question: Urgent!!!!! Need complete MATLAB code for this question, please respond as soon as possible, I will rate it as soon as I get the answer

Urgent!!!!!
Need complete MATLAB code for this question, please respond as soon as possible, I will rate it as soon as I get the answer urgent!!!!!!!. Thank you in advance.
finddx.m
Write a function with the headerline
function [dx]= finddx(Y, limits, actual, tol, method)
Where the user defined inputs are:
Y is an anonymous function under which you want to find the area (the integral)
For example, Y=@(M)cos(M)+12;
limits is a two element array specifying the limits of integration
For example, limits =[-1,3];
actual is the actual value of the integral over the specified limit (you can use wolfram alpha to determine this or use the provided examples)
For the example listed above, actual =48.983;
tol is the tolerance (how close you need to get to the actual integral before stopping the program and outputting dx)
For example, tol =0.1
method is the method you want to use to calculate the integral this should be 'riemann', 'trapezoid', or 'simpson'
For example, method = 'riemann';
You'll see below how we can compare strings in MATLAB to see if they are the same
The output of the function is:
dx is the largest value of dx you can use to calculate the integral within the tolerance using the given method (i.e how thin do the rectangles
have to be to get an accurate enough calculation of the integral?)
Urgent!!!!! Need complete MATLAB code for this

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 Programming Questions!