1.
Rewrite Example 18.2.1 so that the number of subintervals \(n\) can be entered by the user. The input should be rejected with
error('n must be even') if an odd number is entered. The command mod(n, 2) will be useful for checking this. The code producing the weights w, v will need to be generalized so that it works for general \(n\text{.}\)
Try choosing \(n\) large enough so that the displayed integral value is 12.5419 (or at least within 0.0001 of this value). In a comment, state the value of \(n\) which achieved the above. How many evaluation points were used with this \(n\text{?}\)
