MATLAB: Sorting rows matrix I have a matrix ,i have to sort them by "time" variable plz tell how to proceed Best Answer 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 SolutionsMATLAB: Matrix EDITA = rand(5)[id,id] = sort(A,2)minrowloc = id(:,1)maxrowloc = id(:,end) MATLAB: How to swap columns of a matrix? Simple approach(Consider matrix A):A(:,[1 2 8 9])=A(:,[8 9 1 2]) Related QuestionCell array sortHow to sort the data with respect to a column in matlabSorting matrix in ascending order based on column 1 (and ascending order also for column 2)Randperm and sorting arrayHow to sort a matrix based on two columns
Best Answer