Aurelien,
Kill this solution by text searching for "% gallery"
Thanks Richard , I just added this test ;)
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
%% use gallery
filetext = fileread('your_fcn_name.m')
assert(~isempty(strfind(filetext, 'gallery')))
assert( isempty(strfind(filetext, '% gallery')))
Error: Assertion failed.
|
2 | Pass |
%%
n = 5;
expected = [0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
0 1 0 1 0
0 0 1 0 0];
y_correct = logical(expected)
assert(isequal(your_fcn_name(n),y_correct))
y_correct =
0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
0 1 0 1 0
0 0 1 0 0
|
3 | Pass |
%%
n = 9;
expected = [ 0 0 0 0 1 0 0 0 0
0 0 0 1 0 1 0 0 0
0 0 1 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 1 0 1 0 0 0
0 0 0 0 1 0 0 0 0]
y_correct = logical(expected)
assert(isequal(your_fcn_name(n),y_correct))
expected =
0 0 0 0 1 0 0 0 0
0 0 0 1 0 1 0 0 0
0 0 1 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 1 0 1 0 0 0
0 0 0 0 1 0 0 0 0
y_correct =
0 0 0 0 1 0 0 0 0
0 0 0 1 0 1 0 0 0
0 0 1 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 1 0 1 0 0 0
0 0 0 0 1 0 0 0 0
|
27989 Solvers
Find all elements less than 0 or greater than 10 and replace them with NaN
13051 Solvers
835 Solvers
253 Solvers
Calculate the area of a triangle between three points
871 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!