<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242089</link>
    <title>MATLAB Central Newsreader - alphabetic ordering</title>
    <description>Feed for thread: alphabetic ordering</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 23 Feb 2009 22:30:19 -0500</pubDate>
      <title>Re: sorting problems</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242089#630330</link>
      <author>kaori Joo</author>
      <description>Hi, I give you 4 lines (with 11 columns each)&lt;br&gt;
&lt;br&gt;
22	'''ALETA AZUL I, LOBOS DE AFUERA '	'''21/03/2007 21:00:0'	'''23/03/2007 02:00:0'	0,0833333333333333	3	1	'''22/03/2007 06:53:0'	'''22/03/2007 07:08:0'	0,0104166666666667	72&lt;br&gt;
22	'''ALETA AZUL I, LOBOS DE AFUERA '	'''21/03/2007 21:00:0'	'''23/03/2007 02:00:0'	0,0833333333333333	3	2	'''22/03/2007 11:00:0'	'''22/03/2007 12:30:0'	0,0625000000000000	72&lt;br&gt;
22	'''ALETA AZUL I, LOBOS DE AFUERA '	'''21/03/2007 21:00:0'	'''23/03/2007 02:00:0'	0,0416666666666667	3	3	'''22/03/2007 13:46:0'	'''22/03/2007 15:35:0'	0,0756944444444444	72&lt;br&gt;
22	'''ALETA AZUL I, LOBOS DE AFUERA '	'''23/03/2007 03:30:0'	'''23/03/2007 15:05:0'	0,00694444444444444	2	1	'''23/03/2007 06:37:0'	'''23/03/2007 09:05:0'	0,102777777777778	70&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
&quot;us &quot; &amp;lt;us@neurol.unizh.ch&amp;gt; wrote in message &amp;lt;gnchea$up$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;kaori Joo&quot;&lt;br&gt;
&amp;gt; &amp;gt; I managed to sort alphabetically by the second column, but when I try to do so by dates (I first converted it using datenum), I get this error:&lt;br&gt;
&amp;gt; &amp;gt; ??? Error using ==&amp;gt; char&lt;br&gt;
&amp;gt; &amp;gt; Cell elements must be character arrays...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; can you show a very small example of your data...&lt;br&gt;
&amp;gt; us</description>
    </item>
    <item>
      <pubDate>Mon, 16 Feb 2009 20:09:01 -0500</pubDate>
      <title>sorting problems</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242089#628683</link>
      <author>kaori Joo</author>
      <description>Merci for your help. Sorry for not answering before.&lt;br&gt;
&lt;br&gt;
I managed to sort alphabetically by the second column, but when I try to do so by dates (I first converted it using datenum), I get this error:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; char&lt;br&gt;
Cell elements must be character arrays.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; sortrows&amp;gt;sort_cell_back_to_front at 129&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmp = char(x(ndx,k));&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; sortrows at 90&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ndx = sort_cell_back_to_front(x_sub, col);&lt;br&gt;
&lt;br&gt;
I'm trying to fix it but I can't find a way, yet. Any ideas? (I'd really apreciate it).&lt;br&gt;
&lt;br&gt;
&quot;Jiro Doke&quot; &amp;lt;jiro.doke@mathworks.com&amp;gt; wrote in message &amp;lt;gk5upd$dvg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;kaori Joo&quot; &amp;lt;rocio.joo@gmail.com&amp;gt; wrote in message &amp;lt;gk5u0u$m34$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; I have a matrix like this:&lt;br&gt;
&amp;gt; &amp;gt;   Name                       Size              Bytes  Class &lt;br&gt;
&amp;gt; &amp;gt; data                    3653x24            6436668  cell                &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The first column has integers, the second one names (strings), the third one and the fourth one have dates (in string format), and all the other ones have just numbers. I want to sort the matrix by the alphabetical order of the column of names (second column), and then by dates (third column), and then the seventh column.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; What should I do?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Kaori&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Kaori,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You can use SORTROWS.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; sortedData = sortrows(data, [2 3 7]);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; *note: the dates will be sorted alphabetically. You may need to convert the dates to numbers (using DATENUM) before you do the sort.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; jiro</description>
    </item>
    <item>
      <pubDate>Mon, 16 Feb 2009 20:14:02 -0500</pubDate>
      <title>Re: sorting problems</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242089#628686</link>
      <author>us</author>
      <description>&quot;kaori Joo&quot;&lt;br&gt;
&amp;gt; I managed to sort alphabetically by the second column, but when I try to do so by dates (I first converted it using datenum), I get this error:&lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; char&lt;br&gt;
&amp;gt; Cell elements must be character arrays...&lt;br&gt;
&lt;br&gt;
can you show a very small example of your data...&lt;br&gt;
us</description>
    </item>
    <item>
      <pubDate>Thu, 08 Jan 2009 22:17:02 -0500</pubDate>
      <title>alphabetic ordering</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242089#620560</link>
      <author>kaori Joo</author>
      <description>Hi,&lt;br&gt;
I have a matrix like this:&lt;br&gt;
&amp;nbsp;&amp;nbsp;Name                       Size              Bytes  Class &lt;br&gt;
data                    3653x24            6436668  cell                &lt;br&gt;
&lt;br&gt;
The first column has integers, the second one names (strings), the third one and the fourth one have dates (in string format), and all the other ones have just numbers. I want to sort the matrix by the alphabetical order of the column of names (second column), and then by dates (third column), and then the seventh column.&lt;br&gt;
&lt;br&gt;
What should I do?&lt;br&gt;
&lt;br&gt;
Kaori</description>
    </item>
    <item>
      <pubDate>Thu, 08 Jan 2009 22:30:05 -0500</pubDate>
      <title>Re: alphabetic ordering</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/242089#620561</link>
      <author>Jiro Doke</author>
      <description>&quot;kaori Joo&quot; &amp;lt;rocio.joo@gmail.com&amp;gt; wrote in message &amp;lt;gk5u0u$m34$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; I have a matrix like this:&lt;br&gt;
&amp;gt;   Name                       Size              Bytes  Class &lt;br&gt;
&amp;gt; data                    3653x24            6436668  cell                &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The first column has integers, the second one names (strings), the third one and the fourth one have dates (in string format), and all the other ones have just numbers. I want to sort the matrix by the alphabetical order of the column of names (second column), and then by dates (third column), and then the seventh column.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What should I do?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Kaori&lt;br&gt;
&lt;br&gt;
Kaori,&lt;br&gt;
&lt;br&gt;
You can use SORTROWS.&lt;br&gt;
&lt;br&gt;
sortedData = sortrows(data, [2 3 7]);&lt;br&gt;
&lt;br&gt;
*note: the dates will be sorted alphabetically. You may need to convert the dates to numbers (using DATENUM) before you do the sort.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
jiro</description>
    </item>
  </channel>
</rss>

