MATLAB: Sort does not work MATLABsort Am I missing something very obvious or does the built-in sort function not work as it is supposed to? Best Answer Why? for me the indices are correct sorted. The smallest value is found at pos. 3 and the biggest value is found in pos. 4. What is the problem?Note that the documentation says:[B, I] = sort(X)you changed it to:[I, B] = sort(X)So maybe what you expect to get is stored in variable I - not B... Related SolutionsMATLAB: Does “sortrows” not work with a semicolon Remember, sortrows(P,-1); would sort the rows and then would throw away the results because you did not write them to a variable. MATLAB: Sorting Use the sortrows() function instead. Related QuestionSorting
Best Answer