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
Indexing: The Indexing is an alternate to sort a vector. With indexing, the vector is left in its original order. An index vector is used to point values in the original vecto

Logical errors: The Logical errors are more complicated to locate, as they do not result in any error message. The logical error is a mistake in reasoning by the programmer, b

Example of Functions which return values: Calling this function prints the circumference, since there is no way to store the value, hence, it can be used in following computat

Tracing: Sometimes, when a program has loops and/or selection statements and is not running properly, it is helpful in the debugging process to know exactly which statements h

Representing Logical true and False: It has been stated that expressions which are theoretically true really have the integer value of 1, and expressions which are theoretical

Function polyval - interpolation: The function polyval can then be used to compute the polynomial at particular values. For illustration, we could compute at every value in th

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

Run-time or execution-time error: The Run-time, or execution-time, errors are found whenever a script or function is executing. With most of the languages, an illustration of

Nested Structures: The nested structure is a structure in which at least one of the members is itself a structure. For illustration, a structure for the line segment may co

Persistent Variables: Generally, whenever a function stops executing, then the local variables from that function are cleared. That means that each and every time a function i