Question

THIS NEEDS TO BE

ANSWERED IN MATLAB CODING ONLY please use screen shots so I can follow along because these two questions have been answered, but I do not understand how it works!

See problems under image below....

I KNOW HOW TO CALCULATE ALL OF THESE PROBLEMS ALREADY I DON'T KNOW HOW TO CODE IN MATLAB, so if possible show me the steps so I understand, Thank you.

ALSO CAN YOU PLEASE ONLY USE ONE (1) function M FILE


my code doesn't work (see screen shot)

outputs errors

this needs to be able to run all of this data (see below)

>> vpa(myimproperintegral(@(x)4.5*exp(-0.75*x)))
ans =
0.62537006964643897429360481489339

>> vpa(myimproperintegral(@(x)9/x^5.4))
ans =
0.014553394300179510195438787339928

>> vpa(myimproperintegral(@(x)2.6*exp(-1.25*x)))
ans =
0.044901566777145309907390360099547

>> vpa(myimproperintegral(@(x)4.3*exp(-1.5*x)))
ans =
0.03026028154853748901738458470208

>> vpa(myimproperintegral(@(x)1.5*exp(-1.5*x)))
ans =
0.0105559121680944729130411341984

>> vpa(myimproperintegral(@(x)8/x^5.6))
ans =
0.010047002638331100110209488082967

>> vpa(myimproperintegral(@(x)4.5*exp(-1.75*x)))
ans =
0.013086146761883056352775473286745

>> vpa(myimproperintegral(@(x)0.1*exp(-0.75*x)))
ans =
0.010917530494114030472942200552035

>> vpa(myimproperintegral(@(x)7/x^4.2))
ans =
0.05795968985412595989684411807316

>> vpa(myimproperintegral(@(x)7/x^5))
ans =
0.018804938271604938271604938271605

0 0
Add a comment Improve this question Transcribed image text
Answer #1

try to run below code...

function result = myimproperintegral(f)
f = @(x)9./x.^5.4;
xstart = 3;
xend=4;
prevapproxl = integral(f,xstart,xend);
xend++;
approxl = integral(f,xstart,xend);

while(prevapproxl - approxl >= 10.^-2)
prevapproxl = approxl;
xend++;
approxl = integral(f,xstart,xend);
end
result = approxl;
end

Please let me know if you are getting incorrect result.

Add a comment
Know the answer?
Add Answer to:
THIS NEEDS TO BE ANSWERED IN MATLAB CODING ONLY please use screen shots so I can...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB ONLY!! PLEASE WRITE IN COMPUTER SO I CAN COPY PASTE!!! ANSWER COMPLETELY, USE FOR LOOPS....

    MATLAB ONLY!! PLEASE WRITE IN COMPUTER SO I CAN COPY PASTE!!! ANSWER COMPLETELY, USE FOR LOOPS. THE PROGRAM TO BE MODIFIED IS THE NEXT ONE: clc clear % Approximate the value of e ^ x using the Taylor Series x = input( 'Enter the value of x for e^x. x = ' ); t = input( 'Enter the amount of desired terms. t = ' ); i = 1; e_taylor = 0; % initializing the variable for the accumulator while...

  • These questions are to be answered using MATLAB. I only need #3 answered, but #1 provides...

    These questions are to be answered using MATLAB. I only need #3 answered, but #1 provides information (like initial velocity, etc.) required for the questions. I think I have it done, but I'd like to see if there are other ways to use MATLAB for this question. PROJECTILES The distance a projectile travels when fired at an angle 8 is a function of time and can be divided into horizontal and vertical distances. Horizontal (1) = 1.V.cos(0) Vertical(t) = 1•...

  • Please help. New to coding. Please make it neat so I can follow and see the...

    Please help. New to coding. Please make it neat so I can follow and see the steps to understand. Thank you. instructions. This proble is otth 3 poits. You may work in grouzs of 2 if you wish. In order to receive full credit for the project, your project submission MUSI Matlab/Oeteve Python mnst have a copy of your code in addition to the program output. Please put your code on a separate page P 1.1 honogeneous and ot unikorm...

  • Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to...

    Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to plot a 2D sinc function over a 2D cartesian grid where x ranges from 100 to 355 and y ranges from 0 to 255 and the sinc is centered at somewhere not midway in the grid. First plot the grid, and then plot the function on the grid (both as grayscale and as a surface plot). Comment the code well, generate the figures and...

  • Please solve using matlab and show your work so I can see where I am going...

    Please solve using matlab and show your work so I can see where I am going wrong. Your help is appreciated (12 points) Use polynomial interpolation and central difference techniques to compute f and f at x 0.5 using the following unequally spaced data. 1.0 0.0 2.0 f(x) 15.0 2.0 11.0 Hint: fit a parabola through the three data points.

  • ANSWER PART B, I HAVE PART A. MATLAB ONLY!! WRITE IN COMPUTER SO I CAN COPY...

    ANSWER PART B, I HAVE PART A. MATLAB ONLY!! WRITE IN COMPUTER SO I CAN COPY PASTE!! The student must use the following case provided and apply most of the commands leared in the previous modules. You should use the command folder that you must be expanding with each module. Case (Gilat, 2015): The concentration of a drug in the body Cp can be modeled by the equation: Doka (e-ketek) Va (ka-k) Where Do is the dosage administrated (mg). Ve...

  • DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the...

    DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the following calculations. Your script will use the functions you create. Label all graphs appropriately. For this project, do not have your homemade functions fprintf anything, instead have all your fprintf commands within your script. Attach your published script file along with .m files for your functions. Exercise 1. A fundamental iterative method for finding the roots of equations of one-variable is known as Newton's...

  • The problem below is a MATLAB question, please do it only Matlab, if you are not...

    The problem below is a MATLAB question, please do it only Matlab, if you are not familiar with Matlab or not equipped with the program itself on your computer kindly leave it to someone who is. Please show me the Matlab codes for these two parts of the problem, I need to put them in same (m.file) so please consider that. Either you type the code or "preferably" you take a snip of your screen and post to teach me...

  • Write a Matlab Function (not a script) that performs a single iteration of the Euler's method...

    Write a Matlab Function (not a script) that performs a single iteration of the Euler's method for the regular parashot problem, (i.e. just write a function that calculates v_next) Assume: cd = 0.25 [kg/m] for t < 10sec and cd = 1.5   [kg/m] for t ≥ 10sec Hint: use only if-statements, do not use any LOOPs you only need to compute only one iteration Hint2: make sure you define the inputs and outputs of the function correctly Please show how...

  • can you show how the model would look like on matlab ? please help with this question For the circuit given below, find the normal form for the inductor current and capacitor voltage. Use Matlab (...

    can you show how the model would look like on matlab ? please help with this question For the circuit given below, find the normal form for the inductor current and capacitor voltage. Use Matlab (Create an.m file. Use Isim function) and Simulink (Create a Simulink Model). Plot the responses x1 and x2 over time from the M file and Simulink Model. Do they match? Please explain. Use f(t)-e-cos(2t)u(t) for the input. Assume Zero Initial Conditions. 2Ω I H On...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT