Arranging values from highest to lowest using sort function Matlab

조회 수: 7 (최근 30일)
Teoman Selcuk
Teoman Selcuk 2021년 12월 3일
답변: Voss 2021년 12월 3일
Since the sort function sorts the array from the lowest to highest how would I be able to sort an array from the highest to lowest? SO I want to get the inverse of the sort function how is that doable?
a = [6,3,4,11];
sort_a = sort(a);

채택된 답변

Voss
Voss 2021년 12월 3일
sort_a = sort(a,'descend');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by