help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting of words


From: Gabriel Panzenboeck
Subject: Re: Sorting of words
Date: Fri, 25 Feb 2000 18:13:30 +0100 (CET)

On Fri, 25 Feb 2000, SZABO Sandor wrote:

> Dear Octave users,
> 
> I use Octave 2.0.16 and I have the following problem. I want to sort
> alphabetically the words: "apple", "dog", "long". I tried with SORT
> function without success. How can I solve this problem?

a quick and dirty solution:

a=['dog';'long';'apple']
[s,i]=sort(toascii(a(:,1)))
b=a(i,:)

g.


| address@hidden



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]