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 |
A = [1 0 0 0 0;...
0 1 0 0 0;...
0 0 1 0 0;...
0 0 0 1 0;...
0 0 0 0 1];
B = [0 1 0 0 0;...
0 0 1 0 0;...
0 0 0 1 0;...
0 0 0 0 1;...
1 0 0 0 0];
tf_correct = 0;
assert(isequal(intersection_of_matrices(A,B),tf_correct))
check1 =
1×5 logical array
0 0 0 0 0
tf1 =
0
check2 =
1×5 logical array
0 0 0 0 0
tf2 =
0
|
2 | Pass |
A = [1 1 0 0 0;...
0 1 1 0 0;...
0 0 1 1 0;...
0 0 0 1 1;...
1 0 0 0 1];
B = [0 0 0 0 1;...
1 0 0 0 0;...
0 1 0 0 0;...
0 0 1 0 0;...
0 0 0 1 0];
tf_correct = 0;
assert(isequal(intersection_of_matrices(A,B),tf_correct))
check1 =
1×5 logical array
0 0 0 0 0
tf1 =
0
check2 =
1×5 logical array
0 0 0 0 0
tf2 =
0
|
3 | Pass |
A = [1 1 0 0 1;...
1 1 1 0 0;...
0 1 1 1 0;...
0 0 1 1 1;...
1 0 0 1 1];
B = [0 0 1 0 0;...
0 0 0 1 0;...
0 0 0 0 1;...
1 0 0 0 0;...
0 1 0 0 0];
tf_correct = 0;
assert(isequal(intersection_of_matrices(A,B),tf_correct))
check1 =
1×5 logical array
0 0 0 0 0
tf1 =
0
check2 =
1×5 logical array
0 0 0 0 0
tf2 =
0
|
4 | Pass |
A = [1 1 1 0 1;...
1 1 1 1 0;...
0 1 1 1 1;...
1 0 1 1 1;...
1 1 0 1 1];
B = [0 1 0 0 0;...
1 0 0 0 0;...
0 0 0 0 1;...
0 0 0 1 0;...
0 0 1 0 0];
tf_correct = 1;
assert(isequal(intersection_of_matrices(A,B),tf_correct))
check1 =
1×5 logical array
1 1 1 1 1
tf1 =
1
check2 =
1×5 logical array
1 1 1 1 1
tf2 =
1
|
5 | Pass |
A = [1 1 0 0 1;...
1 1 1 0 0;...
0 1 1 1 0;...
0 0 1 1 1;...
1 1 0 1 1];
B = [0 0 1 0 0;...
0 0 0 1 0;...
0 0 0 0 1;...
1 0 0 0 0;...
0 1 0 0 0];
tf_correct = 1;
assert(isequal(intersection_of_matrices(A,B),tf_correct))
check1 =
1×5 logical array
0 1 0 0 0
tf1 =
1
check2 =
1×5 logical array
0 0 0 0 1
tf2 =
1
|
Find the two most distant points
1628 Solvers
Project Euler: Problem 6, Natural numbers, squares and sums.
1018 Solvers
613 Solvers
169 Solvers
Check that number is whole number
1070 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!