Please Use matlab and show command window. Please go through all steps Using a Dialog button with...

70.2K

Verified Solution

Question

Programming

Please Use matlab and show command window. Please go through allsteps

Using a Dialog button with 3 buttons have the user chose one ofthe 3 anonymous functions below to be used in the later selectedthree Programmed functions (1) Integral by Trapezoidal Method,(2)Integral by Simpson Method, or (3) Root by BiSection Method.:

a. f(x) = 2*x^5 -3*x^2 – 5

b. f(x) = x^2 – 5

c. f(x) = x^(1/2)

2. Using an input statement ask the user to pick Midpoint,Simpson, or ROOT. Make sure you are consistent with string ornumber. You can use what you are comfortable with. The inputvariable will then be used in a switch case statement. Each casewill do the following

a. First case (Midpoint Integral) i. Ask for the three inputs a,b, and n ii. Call the function iii. Use fprintf to output theanswer

b. Second case (Simpson Integral) i. Ask for the three inputs a,b, and n ii. Call the function iii. Use fprintf to output theanswer

c. Third case (ROOTs) i. Ask for the three inputs a, b, andepsilon the convergence limit ii. Call the function iii. Usefprintf to output the answer

Answer & Explanation Solved by verified expert
3.8 Ratings (632 Votes)
function result Midpointf a b samples x linspaceabsamples dx absamples result 0 for i 1samples result result fxi dxdx end end function result Simpsonfab samples dx basamples x linspaceabsamples result 0 for i 1samples if i 1 result result fxi else if modi 2 0 result result 4 fxi else result result 2 fxi end end end result dx 3 result end function result    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students