Broken test suite? The handle wont work in some cases
Yes, it seems that test suit is wrong. cases 13 e 14 won't work.
For instance from case 13:
A=false; X=@(x)rem(x,2); str='F(''F(''''X(3)'''')'')';
if I execute F(str) inside my function AnswerGenerator it complains...
Error using eval
Unrecognized function or variable 'F'.
It seems the syntax is wrong. So we cannot know what the answer would be from the knight or the knave (I'm trying to fix the string input).
So I was able to fix the strings (str) manually using replace. Previous solutions won't work, so I guess the test cases were changed and broken. Please ignore my solution if this is fixed later on (it's only right for now, fixing it and evaluating it manually is a pain). I will resubmit a proper solution when it is fixed and I see it fixed.
Sum all integers from 1 to 2^n
Make an awesome ramp for a tiny motorcycle stuntman
Is A the inverse of B?
middleAsColumn: Return all but first and last element as a column vector
Set the array elements whose value is 13 to 0
Knights and Knaves (part 2)
fly fly away
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