Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
strmatch related

Subject: strmatch related

From: Wendy

Date: 26 Jul, 2010 14:59:05

Message: 1 of 2

Hi all,

I have a list of names, for instance

A = {'PRE_BCELL2.3'
'BCELLA1.2.3.4'
'BASO1'
'MEGA1.2'
'BCELLA1.2.3.4'
'NKA1'
'GMP.GRAN1.2.3'
'NKA2.3.TCELL'
'MONO1.2'
'MONO1.2'};

I also have a reference numbers of these names as following

1 HSC1.3
2 MEP.ERY1.2
3 MEGA1.2
4 GMP.GRAN1.2.3
5 MONO1.2
6 BASO1
7 PRE_BCELL2.3
8 BCELLA1.2.3.4
9 NKA1
10 NKA2.3.TCELL
11 DENDA1.2

I want to find the reference numbers of each name in my vector A at once. Right now, I am using strmatch the name in the reference list to strarray A one by one. As my list of strarray is long, I wonder if there is a way that I can find all the reference numbers of all the elements in the strarray A at once.

Thank you in advance,
Wendy

Subject: strmatch related

From: us

Date: 26 Jul, 2010 15:07:05

Message: 2 of 2

"Wendy " <wlq121@gmail.com> wrote in message <i2k7ro$dom$1@fred.mathworks.com>...
> Hi all,
>
> I have a list of names, for instance
>
> A = {'PRE_BCELL2.3'
> 'BCELLA1.2.3.4'
> 'BASO1'
> 'MEGA1.2'
> 'BCELLA1.2.3.4'
> 'NKA1'
> 'GMP.GRAN1.2.3'
> 'NKA2.3.TCELL'
> 'MONO1.2'
> 'MONO1.2'};
>
> I also have a reference numbers of these names as following
>
> 1 HSC1.3
> 2 MEP.ERY1.2
> 3 MEGA1.2
> 4 GMP.GRAN1.2.3
> 5 MONO1.2
> 6 BASO1
> 7 PRE_BCELL2.3
> 8 BCELLA1.2.3.4
> 9 NKA1
> 10 NKA2.3.TCELL
> 11 DENDA1.2
>
> I want to find the reference numbers of each name in my vector A at once. Right now, I am using strmatch the name in the reference list to strarray A one by one. As my list of strarray is long, I wonder if there is a way that I can find all the reference numbers of all the elements in the strarray A at once.
>
> Thank you in advance,
> Wendy

a hint:

     help ismember;

us

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us