As Richard made me notice by email, tests 5 and 6 (using randi and non-integer) were not enable. As I have rescored all solutions, some previous solutions which passed the test, do not pass it anymore.
Can you please set a tolerance for the submitted answers? Using exp(log(x)+log(y)) fails nearly all possibilities for test case 5, with the biggest error being roughly 2.5e-11.
Nice one. It would be more challenging to add a test case where both function arguments are decimal numbers. :)
You can try adding, and something wonderful happens.
Most foul one
exp(log(x)+log(y)) works with a trivial amount of roundoff error. Matlab is a numeric language. Using Isequal() is dumb.
i cant understand why test 1 fails :/
It fails because you use the minus sign and there is the following test :
good use of 'linspace'
What if _both_ x _and_ y were either negative or non-integers though?
Test 1 is always showing Fail. This is disgusting. May be some error on the creator part. Kindly check...
The error for Test 1 says "Output argument 'output' (and maybe others) not assigned". Close examination of your code reveals that when x is 1 and y is 2, you go down the first switch of the outer "if" statement, and sure enough, output never gets assigned and the function fails.
Only works for scalars of course.
Return the largest number that is adjacent to a zero
Create a cell array out of a struct
Split a string into chunks of specified length
Basics: 'Find the eigenvalues of given matrix
03 - Matrix Variables 2
Set the array elements whose value is 13 to 0
Create a matrix from a cell
Cody Computer Part 2 - Get the license number of Cody Computer
Cody Computer Part 5 - Guess the Name of Cody Computer
Unique values without using UNIQUE function
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