Function sortrows - sorting strings, MATLAB in Statistics

function sortrows - sorting strings:

The function sortrows sorts each and every row as a block, or group, and it also will work on numbers. Here in this illustration the rows starting with 3 and 4 are placed first then, for the rows starting with 5, the values in the second column (6 and7) determine the order.

>> mat = [5 7 2; 4 6 7; 3 4 1; 5 6 2]

mat =

5 7 2

4 6 7

3 4 1

5 6 2

>> sortrows(mat)

ans =

3 4 1

4 6 7

5 6 2

5 7 2

Posted Date: 10/22/2012 7:48:04 AM | Location : United States







Related Discussions:- Function sortrows - sorting strings, Assignment Help, Ask Question on Function sortrows - sorting strings, Get Answer, Expert's Help, Function sortrows - sorting strings Discussions

Write discussion on Function sortrows - sorting strings
Your posts are moderated
Related Questions
Editor/Debugger: The MATLAB has numerous useful functions for debugging, and debugging can also be completed through its editor, which is known as the Editor/Debugger. Typi

Functions which return Values versus printing: Also, the function which computes and returns values (throughout the output arguments) does not generally print them; that is le

Rectangle - graphics objects: The other core graphics object is the rectangle that can have curvature added to it (!!). Merely calling the function rectangle without any argum

Illustration of Median When the vector is not in sorted order to start with, the median function will still return the right answer (it will sort the vector automatically). For

Illustration of Input in a for loop: In this illustration, the loop variable iv iterates through the values 1 through 3, therefore the action is repeated three times. The acti

Illustration of Mode When there is more than one value with similar (highest) frequency, then the smaller value is mode. In the case below, as 3 and 8 appear twice in the vecto

Core Objects: The Core Objects in MATLAB are the very fundamental graphics primitives. The description can be found under the MATLAB Help: Under the Contents tab, click the Ha

Execution of persistent variables: The functions can also be called from the script or from the Command Window, as shown here. For illustration, the functions are called first

WHILE Loops: The while statement is used as a conditional loop in MATLAB; it is used to repeat an action whenever ahead of the time it is not known how many times the action w

Vectors of nested structures: The Combining vectors and nested structures are possible to have a vector of structures in which several fields are structures themselves. Here i