I want to find the second largest and minimum value in array? A=[1;10;15;30;40;50;100].I want to get the result as Second minimum value=10 and second largest value=50 Help me plz...
No products are associated with this question.
function [ y ] = second_min( x )
y = min(x(x>min(x)));
function [ y ] = second_max( x )
y = max(x(x<max(x)));
Play games and win prizes!Learn more