1. Engineering
  2. Computer Science
  3. please write matlab code for the following questions...

Question: please write matlab code for the following questions...

Question details

Please write MATLAB code for the following questions:

1. Write a Matlab code that returns the integral of the function sin on the domain E [0,1]. Use Trapezoidal rule with N 3,5, 9, 17 intervals so you can see how the approximation changes as the number of intervals increases. 2. Use your code to calculate the absolute error in the integral as a function of N. Make a loglog plot of the errors versus N for N = 3,5, 9.17. 3. Repeat part 1 but this time write a code that uses Gauss method to find the integral. Use N 2,3, 4 gauss points and make a loglog plot of the errors versus N for N = 2.3.4.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution