Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Find index of sublist' topicStudent Support Forum > General > Archives > "Find index of sublist"

Next Comment >Help | Reply To Topic
Author Comment/Response
Tom
03/25/09 10:09pm

Hi,

It's easy to find the position of a SINGLE element in a list:

In: Position[ {x,2,x,y,4,y}, x ]
Out: {{1}, {3}}



I want to find the position of a list of elements inside of a larger list. For example,

In: myFunction[ {x,2,x,y,4,y}, {x,y} ]
Out: {{3}}




Thanks,
Tom

URL: ,

Subject (listing for 'Find index of sublist')
Author Date Posted
Find index of sublist Tom 03/25/09 10:09pm
Re: Find index of sublist yehuda ben-s... 03/29/09 01:12am
Re: Re: Find index of sublist Tom 03/29/09 5:09pm
Next Comment >Help | Reply To Topic