MATLAB: Finding the maximum of values after and before a specific value arraymaximum hello, I have a doubt.Is it possible to find out the maximum values before and after the ith element in an array? Best Answer One approach:a=randi([1 10],1,10);ind=4;%4th element in a vector is chosena1=a(1:ind-1);a2=a(ind+1,end);max(a1)max(a2) Related SolutionsMATLAB: Finding 2nd minimum value in an array A2 = sort(A(:));out = A2(2);other way:A2 = unique(A(:));out = A2(2);or:out = min(setdiff(A(:),min(A(:))));etc. MATLAB: How do i find argmax [argvalue, argmin] = min(x); [argvalue, argmax] = max(x); Related QuestionUpdating values in array based on index vectorMinimum value array issueUsing index of 3d array from max option to access elements from another 3d arraySetting min and max values of an arrayHow to find maximum without duplicatesSort rows of a matrix based on their maximum value
Best Answer