Solution Library

MATLAB Code that Computes Numerical Approximations of an Integral


Write a MATLAB code that computes the following approximations to the integral  dx

  • Left Riemann sums approximation.
  • Riemann sums for midpoint rule.
  • The trapezoid rule
  • Simpson approximation 

Inputs: the function to integrate, the integration interval and the number of subintervals in the partition.

Outputs: the four integral estimations.


This question belongs to MATLAB software and discusses about to write a MATLAB code that computes Left Riemann sums, trapezoid rule and etc approximations for the given integral.

Answer is in MATLAB format


Download Full Solution


  • HWA

    this is a very good website

  • HWA

    I have 50 questions for the same test your page is showing only 28

  • HWA

    hi can you please help or guide me to answer my assignments. thanks

  • HWA

    hi can anyone help or guide me to my assignments. thanks

  • HWA

  • HWA

    This solution is perfect ...thanks

  • HWA

    Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes

  • HWA

    Perfect bank of solution. 

  • HWA

    great !

  • HWA
    Paul Brandon-Fritzius

    thanks for the quick response. the solution looks good. :)

  • HWA
    tina Johnson

    thnx for the answer. it was perfect. just the way i wanted it. 

  • HWA

    works fine.