I solved the first test suite symbolically to make sure I was on the right path an got:
[1.0, 6.4839432567518947511762312927844, 9.0049224364695494006414430797622, 8.992494072596270056922480305016, 6.9752731606055591524878412503205, 3.6901871946858786387135688683041, 0].
I am not sure why it would be wrong.
Dy = diff(y);
Sorry David. I made a mistake with the signs in the last term of the equation. I "modified" the problem description (quotes intentional). This version should work, but please let me know if it doesn't.
Find all elements less than 0 or greater than 10 and replace them with NaN
Find relatively common elements in matrix rows
Alphabetize by last name
First N Perfect Squares
Generate N equally spaced intervals between -L and L
Identify eban numbers
Create a sequence of primes p such that p > n π(p)
List composite numbers that cannot be written as the sum of two primes
Determine whether a number is unprimeable
Play Outside In with primes
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