Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
A = magic(3);
mask = logical([0 1 1; 0 1 1; 0 1 1]);
y_correct = [1 6; 5 7; 9 2];
assert(isequal(logicalBlock(A,mask),y_correct))
|
2 | Pass |
A = magic(4);
mask = logical([0 0 0 0; 0 1 1 0; 0 1 1 0; 0 0 0 0]);
y_correct = [11 10; 7 6];
assert(isequal(logicalBlock(A,mask),y_correct))
|
3 | Pass |
A = magic(4);
mask = logical([1 1 1 0; 1 1 1 0; 0 0 0 0; 0 0 0 0]);
y_correct = [16 2 3; 5 11 10];
assert(isequal(logicalBlock(A,mask),y_correct))
|
4 | Pass |
A = magic(5);
mask = logical(ones(5));
y_correct = magic(5);
assert(isequal(logicalBlock(A,mask),y_correct))
|
96 Solvers
middleAsColumn: Return all but first and last element as a column vector
387 Solvers
How long is the longest prime diagonal?
338 Solvers
277 Solvers
Change the sign of even index entries of the reversed vector
296 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!