Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
h = counter;
assert(isequal(h(), 1))
assert(isequal(h(), 2))
assert(isequal(h(), 3))
assert(isequal(h(), 4))
assert(isequal(h(), 5))
ans =
1
ans =
2
ans =
3
ans =
4
ans =
5
|
2 | Pass |
%%
code = fileread('counter.m');
assert(isempty(strfind(code, 'persistent')));
|
1398 Solvers
284 Solvers
180 Solvers
351 Solvers
Create an n-by-n null matrix and fill with ones certain positions
268 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!