Cody

Problem 42532. Find minimum and maximum elements of an array

Solution 1618045

Submitted on 28 Aug 2018
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
a = [12 78 5 23 09 67 82 18]; y_correct = [5 82]; assert(isequal(min_max(a),y_correct))

Undefined function or variable 'x'. Error in min_max (line 2) [min(x) max(x)]; Error in Test1 (line 3) assert(isequal(min_max(a),y_correct))

2   Fail
a = [12 178 15 23 09 67 82 18]; y_correct = [09 178]; assert(isequal(min_max(a),y_correct))

Undefined function or variable 'x'. Error in min_max (line 2) [min(x) max(x)]; Error in Test2 (line 3) assert(isequal(min_max(a),y_correct))

Suggested Problems

More from this Author18

Community Treasure Hunt

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

Start Hunting!