Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Comparison of List entries' topicStudent Support Forum > General > Archives > "Comparison of List entries"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
03/10/13 01:35am

Perhaps one of these will do what you need.

In[1]:= p={"EURO4","EURO6"};
q={"EURO3","EURO4","EURO5","EURO6","EEV"};
f[s_]:={s==First[p],s==Last[p]};
Map[f,q]

Out[4]= {{False,False},
{True,False},
{False,False},
{False,True},
{False,False}}

In[5]:= g[s_]:={If[s==First[p],1,0],If[s==Last[p],1,0]};
Map[g,q]

Out[8]= {{0,0},
{1,0},
{0,0},
{0,1},
{0,0}}

URL: ,

Subject (listing for 'Comparison of List entries')
Author Date Posted
Comparison of List entries Wolfgang Tru... 03/09/13 03:41am
Re: Comparison of List entries Bill Simpson 03/10/13 01:35am
Re: Re: Comparison of List entries Wolfgang Tru... 03/11/13 04:51am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic