I have the feeling it's a cheat no ? We don't stay in the problem's definitions.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
A=true; B=false; X=1;
f=inline('logical(interp1([0,1],[0,x],1))','x','A','B','X');
fA=@(str)xor(~A,f(eval(str),A,B,X));
fB=@(str)xor(~B,f(eval(str),A,B,X));
clear f A B X;
assert(isequal(solver(fA,fB),1))
|
2 | Pass |
A=true; B=false; X=2;
f=inline('logical(interp1([0,1],[0,x],1))','x','A','B','X');
fA=@(str)xor(~A,f(eval(str),A,B,X));
fB=@(str)xor(~B,f(eval(str),A,B,X));
clear f A B X;
assert(isequal(solver(fA,fB),2))
|
3 | Pass |
A=false; B=true; X=1;
f=inline('logical(interp1([0,1],[0,x],1))','x','A','B','X');
fA=@(str)xor(~A,f(eval(str),A,B,X));
fB=@(str)xor(~B,f(eval(str),A,B,X));
clear f A B X;
assert(isequal(solver(fA,fB),1))
|
4 | Pass |
A=false; B=true; X=2;
f=inline('logical(interp1([0,1],[0,x],1))','x','A','B','X');
fA=@(str)xor(~A,f(eval(str),A,B,X));
fB=@(str)xor(~B,f(eval(str),A,B,X));
clear f A B X;
assert(isequal(solver(fA,fB),2))
|
128 Solvers
2814 Solvers
583 Solvers
Find out sum and carry of Binary adder
380 Solvers
(Linear) Recurrence Equations - Generalised Fibonacci-like sequences
150 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!