Cody

Solution 313275

Submitted on 31 Aug 2013
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
%% myf=@(x) det(x); yourf = flexf(myf); x={[1 2;3 4],7,[1 2 3; 4 5 6; 2 3 1],3,[2 -1 ; 1 -1]}; [a,~,b,c]=yourf(x{:}); y_correct = {-2 9 3}; assert(isequal({a b c},y_correct));
Error: Too many output arguments.
2   Fail
%% myf=@(x) x.^2; yourf = flexf(myf); x={[1 2;3 4],7,[1 2 3; 4 5 6; 2 3 1],3,[2 -1 ; 1 -1]}; [a,~,b,c]=yourf(x{:}); y_correct = cellfun(myf,x,'uni',0); assert(isequal({a b c},y_correct([1 3 4])));
Error: The right hand side of this assignment has too few values to satisfy the left hand side.