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
Opening and Closing a File: The Files are opened with the fopen function. By the default, fopen function opens a file for reading. If the other mode is preferred, a permission

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

Example of Functions which complete a task: For illustration, the function below just prints the number arguments passed to it in a sentence format: As this function i

Operation on file: We concentrate first on the fgetl function that reads strings from the file one line at a time. The fgetl functions afford more control over how the data is

Illustrations of Sequential search: The two illustrations of calling such function is as shown below: >> values = [85 70 100 95 80 91]; >> key = 95; >> seqsearch

Variable packages: Variable packages are now the vector of structures, hence each and every element in the vector is a structure. To show one element in the vector, an index i

Example of Core objects: The one core graphics object is a line that is also what the plot function produces. Here is an illustration of generating a line object, altering som

fopen function - file function: The fopen opens the file for reading. The fscanf then reads each line one double and one character, and put each pair in individual columns in

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

Program of Persistent variables: The program below elaborates this. The script calls a function func1 that initializes a variable count to 0, then increment it, and print the