Cody

# Problem 44031. Matrix Manipulation

Solution 1111255

Submitted on 27 Jan 2017 by Alexander Levedahl
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = [3 2 1 3; 3 0 0 1; 0 4 3 1]; y = matrixManipulation(x); v = 3:15; assert(isequal(x(1,:),y(1,:))) assert(isempty(setdiff(y(2,:),v))) assert(isempty(setdiff(y(3,:),v)))

t = 15 3 7 13 14 12 13 6 7 15 9 11 ans = 3×1 logical array 0 1 1 x = 3 2 1 3 14 12 13 6 7 15 9 11

2   Pass
x = eye(4); y = matrixManipulation(x); v = 3:15; for i = 1:4 assert(isempty(setdiff(y(i,:),v))) end

t = 10 9 5 5 8 8 6 10 14 15 7 7 4 9 15 7 ans = 4×1 logical array 1 1 1 1 x = 10 9 5 5 8 8 6 10 14 15 7 7 4 9 15 7

3   Pass
x = ones(4); y = matrixManipulation(x); assert(isequal(x,y))

t = 3 4 11 8 5 12 9 3 12 6 3 5 13 14 6 12 ans = 4×1 logical array 0 0 0 0 x = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!