# Use matlab please. Exercise 2 Use the functions you coded in Exercise 1 to compute the...

###### Question:  Exercise 2 Use the functions you coded in Exercise 1 to compute the numerical approximation of the integral .1 cos e 30 To this end, write a Matlab/Octave function function [en,et , es] test-integration() =
that returns the following items: em, et, es: row vectors with components the absolute values of the integration errors llref-Inl n=2.3, . . . . 100 obtained with the midpont (vector em), trapezoidal (vector et) and Simpson (vector es) rules. Here, f 1.6851344770476 is the reference value of the integral (2) while In is the numerical approximation obtained by using the composite midpoint, trapezoidal, and Simpson rules with n nodes The function test integration) should also return the plot of the integrand function ap- pearing in (2) in figure(1), and the plots of the errors em, et and es versus n in a log-log scale in figure(2) (one figure with three plots). (Hint: use the Matlab command loglog)).

#### Similar Solved Questions

##### A 1.40 kΩ resistor is connected in series with a 0.800 kΩ resistor. This pair of...
A 1.40 kΩ resistor is connected in series with a 0.800 kΩ resistor. This pair of resistors is connected in parallel with a 7.00 kΩ resistor. That combination is then connected in series with a 0.700 kΩ resistor and a 9.0-V ideal battery (no internal resistance of course). A) ...
##### A drop of water on a countertop reflects light from a flower held 3.10 cm directly...
A drop of water on a countertop reflects light from a flower held 3.10 cm directly above it. The flower's diameter is 1.90 cm, and the diameter of the flower's image is 0.115cm. What is the focal length of the water drop, assuming that it may be treated as a convex spherical mirror? = cm?...
##### Show me what i did wrong 5. (8 pts) Make an accuwe graph of the piecewise-defined...
show me what i did wrong 5. (8 pts) Make an accuwe graph of the piecewise-defined function xe-2 - 25x24 17-2x, x24 2x. 4r you य Eye Y-72 3 417 6. For the quadratic function f(x) = x + 2x - 8: a) (5 pts.) Determine the coordinates of the vertex algebraically 1473--1)-865 (-1,-9) b) (4 pts. U...
##### Suppose a study on the relationship between gender and political party included 200 men and 200...
Suppose a study on the relationship between gender and political party included 200 men and 200 women and found 180 Democrats and 220 Republicans. Is that information sufficient for you to construct a contingency table for the study? a. Yes b. No For a chi-squared test statistic of 5.02, we would re...
##### How do you divide (2x^2-3x+2)/(x - 1)?
How do you divide (2x^2-3x+2)/(x - 1)?...
##### QUESTION 8 The number of construction projects on a college campus follows a Poisson distribution with...
QUESTION 8 The number of construction projects on a college campus follows a Poisson distribution with a mean of 3. The probability that exactly four construction projects are currently taking place is (Choose the one that is closest to your answer, 0.2240 0.4230 O 0.16810 0.0000...
##### Janet Garcia is considering expanding her business. She plans to hire a salesperson to cover trade...
Janet Garcia is considering expanding her business. She plans to hire a salesperson to cover trade shows. Because of compensation, travel expenses, and booth rental, fixed costs for a trade show are expected to be \$10,120. The booth will be open 23 hours during the trade show. Ms. Garcia also plans ...
##### Find the most general antiderivative of the function f(x) -r-1 +5V2 22 4 cscx
Find the most general antiderivative of the function f(x) -r-1 +5V2 22 4 cscx...
##### 3. A function f(x) that you do not know has the following properties. (6 points total)...
3. A function f(x) that you do not know has the following properties. (6 points total) The domain of the function is (-00,00), and the graph off has no discontinuities. • f'(0) = 0 and f'(9) = 0. . f"(x) > 0 on the interval (-0,3), and F"(x) < 0 on the interval (3,00). f&...
##### Let D be a region in the (a, y)-plane. If a, b, e>0, let Sa be the part of the hyperbolic parabol...
Let D be a region in the (a, y)-plane. If a, b, e>0, let Sa be the part of the hyperbolic paraboloid zary in R3 with (x,y) E D, and let Tb,e be the part of the elliptic paraboloid bz2 + суг in R3 with (z.J) D. For a given a > 0, find b, c > 0 such that Tb.c has the same ar...
##### Linked list: 1) What are their respective logical and physical / storage structures .2) At least...
Linked list: 1) What are their respective logical and physical / storage structures .2) At least one application example combining data structure and algorithm should be given. please answer these two questions properly...
##### Renforcement concrete design (ACI-code 2019) 2- Design the beam for the slab shown below. The beam...
Renforcement concrete design (ACI-code 2019) 2- Design the beam for the slab shown below. The beam is carrying a service moment of 450 kN.m. Take f = 21 MPa and fy = 414 MPa. hf=75mm 1.2m 7.3 m 540 mm 300mm...
##### Why is interphase really not a stage of either type of cell division?
Why is interphase really not a stage of either type of cell division?...
##### A circle's center is at (3 ,3 ) and it passes through (4 ,5 ). What is the length of an arc covering ( pi ) /6  radians on the circle?
A circle's center is at (3 ,3 ) and it passes through (4 ,5 ). What is the length of an arc covering ( pi ) /6 # radians on the circle?...