Example of sorting strings, MATLAB in Statistics

Example of sorting strings:

To sort a cell array of strings, also the sort function is used. The illustration is as follows,

>> engcellnames = {'Chemical','Mechanical',.  .  .

     'Biomedical','Electrical', 'Industrial'};

>> sort(engcellnames')

ans =

  'Biomedical'

  'Chemical'

  'Electrical'

  'Industrial'

  'Mechanical'

 

 

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







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

Write discussion on Example of sorting strings
Your posts are moderated
Related Questions
Index vector: The index vector is then used as the indices for original vector. To get grades vector in ascending order, the indices used would be grades (2), grades (5), and

fscanf function - file function: The fscanf reads matrix variable mat columnwise from the file specified by fid. The 'format' involves conversion characters much similar to th

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 nested for loops and the if statements: For illustration,when the file contains: 33   -11  2  4      5   9 22     5  -7  2     11    3 the outco

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

Illustration of Customizing plots: Illustration, the bar and barh functions by the default place a width of 0.8 between bars. Whenever called as bar(x,y), the width of 0.8 is

Function Stubs: The other common debugging method, which is used when there is a script main program which calls many functions, is to use the function stubs. A function stub

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

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

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