Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re:
Date: Sat, 1 Dec 2007 02:29:41 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <fiqgul$r2o$1@fred.mathworks.com>
References: <fiq28t$6qq$1@fred.mathworks.com> <fiq3pf$4oc$1@canopus.cc.umanitoba.ca> <fiq5me$64a$1@fred.mathworks.com> <fiq6je$k8t$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1196476181 27736 172.30.248.37 (1 Dec 2007 02:29:41 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 1 Dec 2007 02:29:41 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:440307



ahh thats a good idea
I'll have to look into that code this weeeknd - i never
really followed the @ in matlab, but I haven't done my
research on it!

thanks!

"Bruno Luong" <brunoluong@yahoo.com> wrote in message
<fiq6je$k8t$1@fred.mathworks.com>...
> "David Doria" <daviddoria@gmail.com> wrote in message
> <fiq5me$64a$1@fred.mathworks.com>...
> > that actually might work in this case since i'll probably
> > have a one to one mapping from character sets to summed
> > ascii numbers.  however, if i was not sure i would have this
> > one to one mapping , my original question of whether there
> > is some sort of function that already does this holds.
> > 
> 
> Can you just call two modes, one for char, once for integer?
> 
> c={1 2 1 'a' 3 'b' 'a' 2 'a' 10};
> 
> [mostc fc]=mode(double(cell2mat(c(cellfun(@ischar,c)))))
> [mosti fi]=mode(double(cell2mat(c(cellfun(@isnumeric,c)))))
> 
> if fc>fi % char wins
>   mostelem=char(mostc)
> else % integer wins
>   mostelem=mosti
> end
> 
> Bruno
>