Cody

# Problem 44031. Matrix Manipulation

Solution 1190491

Submitted on 16 May 2017 by Said BOUREZG
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)))

x = 3 2 1 3 12 13 5 8 0 4 3 1 x = 3 2 1 3 12 13 5 8 7 6 15 3 ans = 3 2 1 3 12 13 5 8 7 6 15 3

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

x = 11 5 11 9 0 1 0 0 0 0 1 0 0 0 0 1 x = 11 5 11 9 14 6 4 14 0 0 1 0 0 0 0 1 x = 11 5 11 9 14 6 4 14 4 11 7 8 0 0 0 1 x = 11 5 11 9 14 6 4 14 4 11 7 8 10 12 4 5 ans = 11 5 11 9 14 6 4 14 4 11 7 8 10 12 4 5

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

ans = 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!