<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169</link>
    <title>MATLAB Central Newsreader - &quot;mode&quot; function for mixed types</title>
    <description>Feed for thread: &quot;mode&quot; function for mixed types</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>Fri, 30 Nov 2007 22:19:09 -0500</pubDate>
      <title>&quot;mode&quot; function for mixed types</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404014</link>
      <author>David Doria</author>
      <description>I have a cell array like&lt;br&gt;
&lt;br&gt;
[1] [1] [2] [a] [1] [a] [2] [a]&lt;br&gt;
&lt;br&gt;
and i want to determine which is the most frequently&lt;br&gt;
occurring &quot;character&quot; (similar to the &quot;mode&quot; of a strictly&lt;br&gt;
integer array).&lt;br&gt;
&lt;br&gt;
Is there a function that will do this? Or do i have to go&lt;br&gt;
through the array and keep track of which things I have&lt;br&gt;
already counted and all that business?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
David </description>
    </item>
    <item>
      <pubDate>Fri, 30 Nov 2007 22:45:03 -0500</pubDate>
      <title>Re: &quot;mode&quot; function for mixed types</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404017</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fiq28t$6qq$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
David Doria &amp;lt;daviddoria@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I have a cell array like&lt;br&gt;
&lt;br&gt;
&amp;gt;[1] [1] [2] [a] [1] [a] [2] [a]&lt;br&gt;
&lt;br&gt;
&amp;gt;and i want to determine which is the most frequently&lt;br&gt;
&amp;gt;occurring &quot;character&quot; (similar to the &quot;mode&quot; of a strictly&lt;br&gt;
&amp;gt;integer array).&lt;br&gt;
&lt;br&gt;
&amp;gt;Is there a function that will do this?&lt;br&gt;
&lt;br&gt;
hist() or histc(). The easiest way to convert the characters&lt;br&gt;
to numbers is to add 0 to the character: e.g.,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;'hello' + 0&lt;br&gt;
&lt;br&gt;
will be a numeric array of length 5 containing the numeric codes&lt;br&gt;
for each character.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;There are some ideas so wrong that only a very intelligent person&lt;br&gt;
&amp;nbsp;&amp;nbsp;could believe in them.&quot;                            -- George Orwell</description>
    </item>
    <item>
      <pubDate>Fri, 30 Nov 2007 23:17:34 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404024</link>
      <author>David Doria</author>
      <description>that actually might work in this case since i'll probably&lt;br&gt;
have a one to one mapping from character sets to summed&lt;br&gt;
ascii numbers.  however, if i was not sure i would have this&lt;br&gt;
one to one mapping , my original question of whether there&lt;br&gt;
is some sort of function that already does this holds.&lt;br&gt;
&lt;br&gt;
thanks,&lt;br&gt;
&lt;br&gt;
david&lt;br&gt;
&lt;br&gt;
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;fiq3pf$4oc$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fiq28t$6qq$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; David Doria &amp;lt;daviddoria@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;I have a cell array like&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;[1] [1] [2] [a] [1] [a] [2] [a]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;and i want to determine which is the most frequently&lt;br&gt;
&amp;gt; &amp;gt;occurring &quot;character&quot; (similar to the &quot;mode&quot; of a strictly&lt;br&gt;
&amp;gt; &amp;gt;integer array).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;Is there a function that will do this?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; hist() or histc(). The easiest way to convert the characters&lt;br&gt;
&amp;gt; to numbers is to add 0 to the character: e.g.,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  'hello' + 0&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; will be a numeric array of length 5 containing the numeric&lt;br&gt;
codes&lt;br&gt;
&amp;gt; for each character.&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;   &quot;There are some ideas so wrong that only a very&lt;br&gt;
intelligent person&lt;br&gt;
&amp;gt;   could believe in them.&quot;                            --&lt;br&gt;
George Orwell</description>
    </item>
    <item>
      <pubDate>Fri, 30 Nov 2007 23:33:02 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404027</link>
      <author>Bruno Luong</author>
      <description>&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; that actually might work in this case since i'll probably&lt;br&gt;
&amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; ascii numbers.  however, if i was not sure i would have this&lt;br&gt;
&amp;gt; one to one mapping , my original question of whether there&lt;br&gt;
&amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Can you just call two modes, one for char, once for integer?&lt;br&gt;
&lt;br&gt;
c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&lt;br&gt;
[mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
[mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&lt;br&gt;
if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;nbsp;&amp;nbsp;mostelem=char(mostc)&lt;br&gt;
else % integer wins&lt;br&gt;
&amp;nbsp;&amp;nbsp;mostelem=mosti&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 02:29:41 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404035</link>
      <author>David Doria</author>
      <description>ahh thats a good idea&lt;br&gt;
I'll have to look into that code this weeeknd - i never&lt;br&gt;
really followed the @ in matlab, but I haven't done my&lt;br&gt;
research on it!&lt;br&gt;
&lt;br&gt;
thanks!&lt;br&gt;
&lt;br&gt;
&quot;Bruno Luong&quot; &amp;lt;brunoluong@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fiq6je$k8t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; that actually might work in this case since i'll probably&lt;br&gt;
&amp;gt; &amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; &amp;gt; ascii numbers.  however, if i was not sure i would have this&lt;br&gt;
&amp;gt; &amp;gt; one to one mapping , my original question of whether there&lt;br&gt;
&amp;gt; &amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can you just call two modes, one for char, once for integer?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
&amp;gt; [mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;gt;   mostelem=char(mostc)&lt;br&gt;
&amp;gt; else % integer wins&lt;br&gt;
&amp;gt;   mostelem=mosti&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno&lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 21:03:43 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404092</link>
      <author>David Doria</author>
      <description>thanks alot.  the function handle @ is very easy to&lt;br&gt;
understand when you read the help! haha&lt;br&gt;
&lt;br&gt;
dave&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fiqgul$r2o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ahh thats a good idea&lt;br&gt;
&amp;gt; I'll have to look into that code this weeeknd - i never&lt;br&gt;
&amp;gt; really followed the @ in matlab, but I haven't done my&lt;br&gt;
&amp;gt; research on it!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;brunoluong@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fiq6je$k8t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that actually might work in this case since i'll probably&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ascii numbers.  however, if i was not sure i would&lt;br&gt;
have this&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; one to one mapping , my original question of whether there&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Can you just call two modes, one for char, once for integer?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
&amp;gt; &amp;gt; [mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=char(mostc)&lt;br&gt;
&amp;gt; &amp;gt; else % integer wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=mosti&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 21:04:07 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404093</link>
      <author>David Doria</author>
      <description>thanks alot.  the function handle @ is very easy to&lt;br&gt;
understand when you read the help! haha&lt;br&gt;
&lt;br&gt;
dave&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fiqgul$r2o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ahh thats a good idea&lt;br&gt;
&amp;gt; I'll have to look into that code this weeeknd - i never&lt;br&gt;
&amp;gt; really followed the @ in matlab, but I haven't done my&lt;br&gt;
&amp;gt; research on it!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;brunoluong@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fiq6je$k8t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that actually might work in this case since i'll probably&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ascii numbers.  however, if i was not sure i would&lt;br&gt;
have this&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; one to one mapping , my original question of whether there&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Can you just call two modes, one for char, once for integer?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
&amp;gt; &amp;gt; [mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=char(mostc)&lt;br&gt;
&amp;gt; &amp;gt; else % integer wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=mosti&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 21:04:08 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404094</link>
      <author>David Doria</author>
      <description>thanks alot.  the function handle @ is very easy to&lt;br&gt;
understand when you read the help! haha&lt;br&gt;
&lt;br&gt;
dave&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fiqgul$r2o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ahh thats a good idea&lt;br&gt;
&amp;gt; I'll have to look into that code this weeeknd - i never&lt;br&gt;
&amp;gt; really followed the @ in matlab, but I haven't done my&lt;br&gt;
&amp;gt; research on it!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;brunoluong@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fiq6je$k8t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that actually might work in this case since i'll probably&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ascii numbers.  however, if i was not sure i would&lt;br&gt;
have this&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; one to one mapping , my original question of whether there&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Can you just call two modes, one for char, once for integer?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
&amp;gt; &amp;gt; [mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=char(mostc)&lt;br&gt;
&amp;gt; &amp;gt; else % integer wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=mosti&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 21:04:09 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404095</link>
      <author>David Doria</author>
      <description>thanks alot.  the function handle @ is very easy to&lt;br&gt;
understand when you read the help! haha&lt;br&gt;
&lt;br&gt;
dave&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fiqgul$r2o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ahh thats a good idea&lt;br&gt;
&amp;gt; I'll have to look into that code this weeeknd - i never&lt;br&gt;
&amp;gt; really followed the @ in matlab, but I haven't done my&lt;br&gt;
&amp;gt; research on it!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;brunoluong@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fiq6je$k8t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that actually might work in this case since i'll probably&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ascii numbers.  however, if i was not sure i would&lt;br&gt;
have this&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; one to one mapping , my original question of whether there&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Can you just call two modes, one for char, once for integer?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
&amp;gt; &amp;gt; [mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=char(mostc)&lt;br&gt;
&amp;gt; &amp;gt; else % integer wins&lt;br&gt;
&amp;gt; &amp;gt;   mostelem=mosti&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 21:29:50 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404099</link>
      <author>David Doria</author>
      <description>any idea why this got posted so many times?&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fisi89$1uk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; thanks alot.  the function handle @ is very easy to&lt;br&gt;
&amp;gt; understand when you read the help! haha&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; dave&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fiqgul$r2o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; ahh thats a good idea&lt;br&gt;
&amp;gt; &amp;gt; I'll have to look into that code this weeeknd - i never&lt;br&gt;
&amp;gt; &amp;gt; really followed the @ in matlab, but I haven't done my&lt;br&gt;
&amp;gt; &amp;gt; research on it!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; thanks!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Bruno Luong&quot; &amp;lt;brunoluong@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fiq6je$k8t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;lt;fiq5me$64a$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; that actually might work in this case since i'll&lt;br&gt;
probably&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; have a one to one mapping from character sets to summed&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ascii numbers.  however, if i was not sure i would&lt;br&gt;
&amp;gt; have this&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; one to one mapping , my original question of whether&lt;br&gt;
there&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; is some sort of function that already does this holds.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Can you just call two modes, one for char, once for&lt;br&gt;
integer?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; [mosti&lt;br&gt;
fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; if fc&amp;gt;fi % char wins&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;   mostelem=char(mostc)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; else % integer wins&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;   mostelem=mosti&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Sat, 01 Dec 2007 21:31:27 -0500</pubDate>
      <title>Re:</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/160169#404100</link>
      <author>Bruno Luong</author>
      <description>&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fisjoe$idh$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; any idea why this got posted so many times?&lt;br&gt;
&amp;gt; &lt;br&gt;
echo of &quot;hahha&quot;?&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
  </channel>
</rss>

