There may have some limitations when resulting rows are with different lengthes.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = (1:20)';
fh = @(xi) mod(xi, 2) == 0;
y_correct = (2:2:20)';
assert(isequal(filterfun(fh, x), y_correct));
|
2 | Pass |
%%
x = 'Aa is lava.';
fh = @(c) lower(c) == 'a';
y_correct = 'Aaaa';
assert(isequal(filterfun(fh, x), y_correct));
|
3 | Pass |
%%
x = {[]; 1; [1;2]; [2 3 4]; ones(1,1,3)};
fh = @isrow;
y_correct = {1; [2 3 4]};
assert(isequal(filterfun(fh, x), y_correct));
|
Count from 0 to N^M in base N.
220 Solvers
261 Solvers
71 Solvers
131 Solvers
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
168 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!