I'm enjoying these creative solutions.
John, I just tried your file exchange solution out of pure curiosity. Your guess is correct; it does score poorly. I also got the error "You may not use the command(s) builtin in your code" for the test cases. All I did was change only the first line to call the function and the variable names with no other checking. I'll do some real work on it now. :-)
Will not solution like this be sooo much slower than simple loops?! Short yes, efficient no.
well, I think I was wrong...This solution is slower if the degree of the polynomial is small but much faster if the degree gets higher...solving polynomials of high degree is really slow with ROOTS.
Back and Forth Rows
Spherical radius given four points
Rotate a Matrix by 90 degrees
Predicting life and death of a memory-less light bulb
Simpsons's rule (but not Homer Simpson)
Euclidean inter-point distance matrix
Counting the Grand Primes
Sums of cubes and squares of sums
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