Cody

Solution 396584

Submitted on 4 Feb 2014 by LY Cao
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   Pass
%% 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));
ans = @flexf/x
2   Pass
%% 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])));
ans = @flexf/x