Cody

# Problem 2926. Matlab Basics II - Minimum

Solution 1815966

Submitted on 15 May 2019
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 = [1 2 3;4 5 6]; y_correct = [1;4]; assert(isequal(min_per_row(x),y_correct))

1 2 3 4 5 6 1 2 3 4 5 6

Error using str2num (line 35) Input must be a character vector or string scalar. Error in min_per_row (line 9) y(i) = str2num(x(i,1)); Error in Test1 (line 3) assert(isequal(min_per_row(x),y_correct))

2   Fail
x = [7.2 -2.5 5.1;4.2 -9.8 3.6]; y_correct = [-2.5;-9.8]; assert(isequal(min_per_row(x),y_correct))

7.2000 -2.5000 5.1000 4.2000 -9.8000 3.6000 7.2 -2.5 5.1 4.2 -9.8 3.6

Error using str2num (line 35) Input must be a character vector or string scalar. Error in min_per_row (line 9) y(i) = str2num(x(i,1)); Error in Test2 (line 3) assert(isequal(min_per_row(x),y_correct))

3   Fail
x = [pi exp(1) pi/2;3 pi 4]; y_correct = [pi/2;3]; assert(isequal(min_per_row(x),y_correct))

3.1416 2.7183 1.5708 3.0000 3.1416 4.0000 3.1416 2.7183 1.5708 3 3.1416 4

Error using str2num (line 35) Input must be a character vector or string scalar. Error in min_per_row (line 9) y(i) = str2num(x(i,1)); Error in Test3 (line 3) assert(isequal(min_per_row(x),y_correct))