MATLAB: Matrix matrixmax Hi there, I have a square matrix and I want to find location of the maximum and minumum in each row. EDITED! Best Answer EDITA = rand(5)[id,id] = sort(A,2)minrowloc = id(:,1)maxrowloc = id(:,end) Related SolutionsMATLAB: I want to find about indexes that are chosen five from biggest number in 2-d matrix. EditA=randi(100,4,4)[val,id]=sort(A(:),'descend')max_val=val(1:5)id=id(1:5)[ii,jj]=ind2sub(size(A),id) MATLAB: Sorting rows time1 = rand(8,1);yourmatrix = randi(30,8);solution:[id,id] = sort(time1);out = yourmatrix(id,:)OR:out1 = sortrows([time1(:), yourmatrix],1);out = out1(:,2:end) Related QuestionCell array sortUsing find to compare matrices[GIS] Using PostGIS functionalities in Microsoft SQL Server?To order min to max value for matrix’s rowHow to find the index of maximum value in matrixHow to find first two maximum number in the matrix
Best Answer