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
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

Example of Mode When no value appears more often than any other, the smallest value in the vector will be the mode of the vector. >> shortx = [2 5 1 4]; >> mode(shortx

Location of a rectangle - graphics objects: The location of a rectangle is [x y w h], where x and y are the coordinates of the lower left point, here w is the width, and h is

Advanced File Input and Output: In that section, we saw how to read the values entered by user using the input as well as the output functions disp and fprintf, that shows inf

Illustration of Indexing: Though, rather than of creating the index vector manually as shown here, the process to initialize the index vector is use to a sort function. The al

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

Lower Level File I/O Functions: Whenever reading from data file, as long as the data in the file is "regular" the load function works-in another words, the similar type of dat

Illustration of tracing a error: The one way of following the flow of function, or tracing it, is to use the echo function. The echo function, that is a toggle, will show each

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

Illustration of Indexing into vectors of structures: For illustration, the function to print the information from packages has been modified therefore in addition to the vecto