This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
n = 10; c = 3;
M = createMatrix(n,c);
assert( all(sum(M,1)==c) && all(sum(M,2)==c) && all(diag(M)==0) && ...
islogical(M) && ismatrix(M) && all(size(M)==n) )
|
2 | Pass |
n = 2; c = 1;
M = createMatrix(n,c);
assert( all(sum(M,1)==c) && all(sum(M,2)==c) && all(diag(M)==0) && ...
islogical(M) && ismatrix(M) && all(size(M)==n) )
|
3 | Pass |
n = 10; c = 9;
M = createMatrix(n,c);
assert( all(sum(M,1)==c) && all(sum(M,2)==c) && all(diag(M)==0) && ...
islogical(M) && ismatrix(M) && all(size(M)==n) )
|
4 | Pass |
n = 100; c = 50;
M = createMatrix(n,c);
assert( all(sum(M,1)==c) && all(sum(M,2)==c) && all(diag(M)==0) && ...
islogical(M) && ismatrix(M) && all(size(M)==n) )
|
5 | Pass |
n = randi([2 20]); c = randi([1 n-1]);
M = createMatrix(n,c);
assert( all(sum(M,1)==c) && all(sum(M,2)==c) && all(diag(M)==0) && ...
islogical(M) && ismatrix(M) && all(size(M)==n) )
|
6 | Pass |
n = randi([20 100]); c = randi([10 n-1]);
M = createMatrix(n,c);
assert( all(sum(M,1)==c) && all(sum(M,2)==c) && all(diag(M)==0) && ...
islogical(M) && ismatrix(M) && all(size(M)==n) )
|
Find the peak 3n+1 sequence value
1108 Solvers
Is my wife right? Now with even more wrong husband
1241 Solvers
253 Solvers
724 Solvers
Piecewise linear interpolation
299 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!