Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how to find the maximum repetitions in string
Replies: 3   Last Post: Jul 31, 2012 11:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Vijay

Posts: 91
Registered: 8/31/11
Re: how to find the maximum repetitions in string
Posted: Jul 28, 2012 8:02 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <jv1mb2$i3n$1@speranza.aioe.org>...
> On 7/28/2012 4:18 PM, vj wrote:
> > hi,
> > I have a string inside a cell as follows,
> > for n=1:7
> > database{1,n}='vijay';
> > end
> > for n=8:11
> > database{1,n}='someone';
> > end
> >

>
> If the contents are known,
>
> sum(strfind(database,'vijay')>0)
>
> is the count
>
> If not, will have to iterate to find the values -- unique() would be
> good here but it doesn't have a built in parallel for strings that I can
> think of ... an auxiliary hash value would be good for that purpose...
>
> --



Thank you so much!! It helped!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.