Oops. I just noticed that I forgot to rename the function from "compareDoubles" (used in Problem 44690) to "compareSingles". Unfortunately I cannot make the fix now without breaking the two successful submissions. Sorry about any confusion. —DIV
Good problem, but it would be better if base-10 or base-2 was adopted as a standard at the description. It is confusing to keep changing them. And the function name should probably be compareSingles and not compareDoubles. You can fix the test suite by using try and catch while accepting both names for the function.
Thank-you for the tip about using try & catch. I have modified the Test Suite accordingly, so it should be possible now for Cody players to call their function either "compareSingles" or "compareDoubles". When formatted neatly this workaround code distracted from the core content of the Test Suite, so I have crammed it onto one individual line in each separate Test.
Regarding the problem statement, I think this is like real life, and Cody players can figure it out. Some Cody players will find the conversion obvious, so it won't be a hassle for them; other Cody players might find the conversion less obvious, so it's a small extra challenge and learning opportunity for them. (See also Problem 44690.)
Find all elements less than 0 or greater than 10 and replace them with NaN
radius of a spherical planet
given 3 sides, find area of this triangle
Return a list sorted by number of consecutive occurrences
Find the mean of a 2-D matrix after excluding elements of specified sub-matrix
Add all the numbers between two limits (inclusive)
The other half of the Fibonacci sequence
Comparison of floating-point numbers (doubles)
Back to basics: throwing errors / exceptions
Guess the number I'm thinking of (Part 2)
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