Cody

Problem 47305. Find the second biggist number in a vector or a matrix

Solution 3555875

Submitted on 5 Nov 2020 by Abolfazl Chaman Motlagh
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 = [1 2 3 4]; y_correct = 3; assert(isequal(second_biggist(x),y_correct))

2   Pass
x = [1 2 3 4; 5 6 7 8]; y_correct = 7; assert(isequal(second_biggist(x),y_correct))

3   Pass
x = [1 2 3 4; 5 6 7 8; 9 10 11 12]; y_correct = 11; assert(isequal(second_biggist(x),y_correct))

4   Pass
x = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]; y_correct = 15; assert(isequal(second_biggist(x),y_correct))

5   Pass
x = [1 2 3 4]'; y_correct = 3; assert(isequal(second_biggist(x),y_correct))

Suggested Problems

More from this Author2

Community Treasure Hunt

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

Start Hunting!