Answers

Question and Answer:

  Home  Wipro

⟩ How can we sort the elements of the array in descending order in Wipro?

Syntax

B = sort(A)

B = sort(A,dim)

B = sort(...,mode)

[B,IX] = sort(A,...)

Description

B = sort(A) sorts the elements along different dimensions of an array, and arranges those elements in ascending order.

If A is a ... sort(A) ...

Vector Sorts the elements of A.

Matrix Sorts each column of A.

☼ Multidimensional array Sorts A along the first non-singleton dimension, and returns an array of sorted vectors.

☼ Cell array of strings Sorts the strings in ascending ASCII dictionary order, and returns a vector cell array of strings. The sort is case-sensitive; uppercase letters appear in the output before lowercase. You cannot use the dim or mode options with a cell array.

 174 views

More Questions for you: