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: find a string from another string.
Replies: 4   Last Post: Nov 15, 2012 3:44 AM

Advanced Search

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

Posts: 32
Registered: 8/16/12
Re: find a string from another string.
Posted: Nov 15, 2012 2:56 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Nasser M. Abbasi" <nma@12000.org> wrote in message <k823hv$4i7$1@speranza.aioe.org>...
> On 11/15/2012 12:49 AM, Moon Datta wrote:
> > I have a string like below,
> >
> > 'N6E01110925D00ASYWDCC2KYOTO'
> > 'N6E01110925D01ASYWDCC2KYOTO'
> > '....................................................
> > ....................................................
> > 'N6E01110925H00ASYWDCC2KYOTO'
> > 'N6E01110925H01ASYWDCC2KYOTO'
> > '---------------------------------------------------
> > ----------------------------------------------------
> > 'N6E01110925D00SYMWDCC2KYOTO'
> > 'N6E01110925D01SYMWDCC2KYOTO'
> > ----------------------------------------------------
> > ----------------------------------------------------
> > 'N6E01110925H00SYMWDCC2KYOTO'
> > 'N6E01110925H01SYMWDCC2KYOTO'
> >

>
> The above is not a string.
>
> Can you show the data structures that contains all of the above in it?
>
> Is it in cell array? One should post here a complete working code.
>
> either way, may be findstr() can help.
>
>
> --Nasser



Sir,

This is a textdata{} , <288x1 cell>

like
'N6E01110926H08ASYWDCC2KYOTO'
'N6E01110926H09ASYWDCC2KYOTO'
'N6E01110926H10ASYWDCC2KYOTO'
'N6E01110926H11ASYWDCC2KYOTO'
'N6E01110926H12ASYWDCC2KYOTO'
'N6E01110926H13ASYWDCC2KYOTO'
'N6E01110926H14ASYWDCC2KYOTO'
'N6E01110926H15ASYWDCC2KYOTO'
'N6E01110926H16ASYWDCC2KYOTO'
'N6E01110926H17ASYWDCC2KYOTO'
'N6E01110926H18ASYWDCC2KYOTO'
'N6E01110926H19ASYWDCC2KYOTO'
'N6E01110925H00SYMWDCC2KYOTO'
'N6E01110925H01SYMWDCC2KYOTO'
..............................................
...................................................

like I have stated above.
As in the above cells in 13 number row there is H and SYM. The program will give me those index number of the text data whose have the H ans SYM string in it. Here it is 13,14.
Hope I am clear to you.


For these problem I have tried findstr(). But it works for the full contents of a cell like N6E01110926H20ASYWDCC2KYOTO. I want to compare only 'H20ASY' which is in the middle part of the cell.




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.