Bruce, please check the answers to your test suite. Granted, it has been a while since I took calculus in college, but I'm pretty sure the answers aren't all zero. :-)
Never mind...just noticed you were looking for the error differences, and not the actual values. It's been a while since I took a Reading Comprehension class as well...
This is an "honor system" test suite. For the last case, quad('2*x',0,2) gives 3.9999999999999996, while trapz([0:1/n:2],[0:2/n:4]) gives the exact answer 4 for all values of n from 1 to 100, except n=35, 44, 51, 69, 92, or 100, which all give the same answer as quad.
Find all elements less than 0 or greater than 10 and replace them with NaN
How to find the position of an element in a vector without using the find function
Back to basics 11 - Max Integer
Angle between Two Vectors
02 - Vector Variables 2
How many days does the cat take to climb out of the hole?
Find the largest value in the 3D matrix
How long do each of the stages of the rocket take to burn?
Flip the main diagonal of a matrix
Find the Kronecker Tensor Product without using KRON
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office