Cody

# Problem 42875. Assignment Problem

Solution 2502554

Submitted on 9 Jun 2020
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   Fail
x = [2,12,8,5; 4,4,5,12; 3,10,8,3; 12,0,1,2]; y_correct1 = [1,2,4,3]; y_correct2 = [1,4,2,3]; test1 = isequal(Assignment(x),y_correct1); test2 = isequal(Assignment(x),y_correct2); assert(test1||test2)

Unrecognized function or variable 'm'. Error in Assignment (line 2) [~,y]=min(m) Error in Test1 (line 4) test1 = isequal(Assignment(x),y_correct1);

2   Fail
x = [7,5,3,2,6; 6,3,6,6,5; 3,3,9,4,7; 4,5,3,3,4; 2,3,4,3,5]; y_correct = [5,3,4,1,2]; assert(isequal(Assignment(x),y_correct))

Unrecognized function or variable 'm'. Error in Assignment (line 2) [~,y]=min(m) Error in Test2 (line 3) assert(isequal(Assignment(x),y_correct))

3   Fail
x = eye(4); x(x==0) = 3; y_correct = 1:4; assert(isequal(Assignment(x),y_correct))

Unrecognized function or variable 'm'. Error in Assignment (line 2) [~,y]=min(m) Error in Test3 (line 4) assert(isequal(Assignment(x),y_correct))

4   Fail
x = 5 * ones(5); x(1,4) = 1; x(2,2) = 1; x(3,5) = 1; x(4,1) = 1; x(5,3) = 1; y_correct = [4,2,5,1,3]; assert(isequal(Assignment(x),y_correct))

Unrecognized function or variable 'm'. Error in Assignment (line 2) [~,y]=min(m) Error in Test4 (line 8) assert(isequal(Assignment(x),y_correct))

5   Fail
x = 1:4; x = [x; circshift(x,1); circshift(x,2); circshift(x,3)]; y_correct = 1:4; assert(isequal(Assignment(x),y_correct))

Unrecognized function or variable 'm'. Error in Assignment (line 2) [~,y]=min(m) Error in Test5 (line 4) assert(isequal(Assignment(x),y_correct))

6   Fail
x = [7,5,4; 14,16,2; 7,1,9]; y_correct = [1,3,2]; assert(isequal(Assignment(x),y_correct))

Unrecognized function or variable 'm'. Error in Assignment (line 2) [~,y]=min(m) Error in Test6 (line 3) assert(isequal(Assignment(x),y_correct))

### Community Treasure Hunt

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

Start Hunting!