Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
s.f1 = 'Sunday';
s.f2 = 'Monday';
s.f3 = 'Tuesday';
s.f4 = 'Wednesday';
s.f5 = 'Thursday';
s.f6 = 'Friday';
s.f7 = 'Saturday';
f = @numel;
c = structfun(@numel, s);
assert(isequal(structfun2(f,s),c))
|
2 | Pass |
s = struct('f1',{1, [3 4]; 1, [5 6]},'f2',{[1 2], 2; [3 4 5], [2 5]});
f = @(x)min(x(:));
c = {[1;1], [3;2]; [1;3], [5;2]};
assert(isequal(structfun2(f,s),c))
|
3 | Pass |
s = struct('f1',{1, [3 4]; 1, [5 6]},'f2',{[1 2], 2; [3 4 5], [2 5]});
f = @(x)max(x(:));
c = {[1;2], [4;2]; [1;5], [6;5]};
assert(isequal(structfun2(f,s),c))
|
4 | Pass |
s = struct('f1',{0, [3 4]; 1, [5 7 6]},'f2',{[0 0], 2; [2 4 5], [0 5]});
f = @nnz;
c = {[0;0], [2;1]; [1;3], [3;1]};
assert(isequal(structfun2(f,s),c))
|
401 Solvers
Determine if input is a perfect number
113 Solvers
Fix the last element of a cell array
97 Solvers
86 Solvers
203 Solvers