To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
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.
[ii,ii] = sort(A); out = A(ii([2,end-1]));
for your example (A) just:
out = A([2,end-1]);
A1 = unique(A); out = A1([2,end-1]);