Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Cases' topicStudent Support Forum > General > "Cases"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
10/29/12 12:25pm

In[1]:= ss={{H[1],M[1],M[2]},{H[2],H[1],M[2]},{M[1],H[1],H[2]},{H[2],M[2],M[1]}};
Cases[ss,u_/;Head[u[[1]]]==H&&Head[u[[2]]]==M]

Out[2]= {{H[1],M[1],M[2]},{H[2],M[2],M[1]}}

URL: ,

Subject (listing for 'Cases')
Author Date Posted
Cases Sinval Santos 10/29/12 08:12am
Re: Cases Bill Simpson 10/29/12 12:25pm
< Previous CommentHelp | Reply To Comment | Reply To Topic