Question: My code so far is: function improper = myimproperintegral(f,a,t) old = int(f,a,a); n=1; new = int(f,a,[a,a+n]); while(abs(int(new-old)>=t)) old=new; n=n+1; new=int(f,a,[a,a+n]); end improper=new; end I am

 My code so far is: function improper = myimproperintegral(f,a,t) old =

My code so far is:

function improper = myimproperintegral(f,a,t) old = int(f,a,a); n=1; new = int(f,a,[a,a+n]); while(abs(int(new-old)>=t)) old=new; n=n+1; new=int(f,a,[a,a+n]); end improper=new; end

I am getting errors, don't know what's wrong.

4. myimproperintegral(f,a,t) which takes three inputs: f: A function handle. a: A real number. t: A real number Note: You may assume that S f(r) dx converges and that t>0 Does: Uses a while loop to calculate a+2 f(x)dx, f(x)dr, /(r)dr,.. until successive integrals differ by less than t Returns: The final calculated integral. 4. myimproperintegral(f,a,t) which takes three inputs: f: A function handle. a: A real number. t: A real number Note: You may assume that S f(r) dx converges and that t>0 Does: Uses a while loop to calculate a+2 f(x)dx, f(x)dr, /(r)dr,.. until successive integrals differ by less than t Returns: The final calculated integral

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!