class13 - PHYS 5900 Class 13 (9/23/2009) Zi-Wei Lin...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
PHYS 5900 Class 13 (9/23/2009) Zi-Wei Lin Homework #1 grades are posted to "Gradebook" at Blackboard; your homework with my comments are returned to "Assignments"; homework solutions are posted to "Course Docs". Rearranging the element order in Lists we can use Sort, Union[list], Reverse, RotateLeft, RotateRight, Permutations In[1]:= ? Sort In[2]:= ? Union In[3]:= Sort @8 a b ,a ,d ,2 5, Ac, 10, 5.5, 1 ê 4, 19 ê 2, 1 <D Out[3]= : 1, 1 4 , 5.5, 19 2 ,10,10,a,ab,Ac,d > Sort returns a list in increasing order (for numbers) or in alphabetical order (for symbols); numbers precede symbols. In[4]:= Union @8 a b ,a ,d ,2 5, Ac, 10, 5.5, 1 ê 4, 19 ê 2, 1 <D Out[4]= : 1, 1 4 , 5.5, 19 2 ,10,a,ab,Ac,d > In[5]:= Range @ 10 D Out[5]= 8 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 < In[6]:= RotateLeft @ % D Out[6]= 8 2, 3, 4, 5, 6, 7, 8, 9, 10, 1 < In[7]:= RotateRight @ %% ,3 D Out[7]= 8 8,9,10,1,2,3,4,5,6,7 < In[8]:= Permutations @8 A, b, c <D Out[8]= 88 A, b, c < , 8 A, c, b < , 8 b, A, c < , 8 b, c, A < , 8 c, A, b < ,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
In[10]:= ourList = 8 a, b, c, d, e < Out[10]= 8 a, b, c, d, e < In[11]:= Partition @ ourList, 2 D Out[11]= 88 a, b < , 8 c, d << In[12]:= Partition @ ourList, 2, 1 D Out[12]= 88 a, b < , 8 b, c < , 8 c, d < , 8 d, e << In[13]:= Partition @8 a, b, c, d, e < ,2 ,2 D Out[13]= 88 a, b < , 8 c, d << In[14]:= Partition @8 a, b, c, d, e < ,2 ,3 D Out[14]= 88 a, b < , 8 d, e << In[15]:= Split @8 a, a, b, b, c, c, d, a, a, e <D Out[15]= 88 a, a < , 8 b, b < , 8 c, c < , 8 d < , 8 a, a < , 8 e << In[16]:= ? Transpose In[17]:= MatrixForm @88 0, 1, 2, 3 < , 8 0, 1, 4, 9 <<D Out[17]//MatrixForm= 0123 0149 In[18]:= Transpose @88 0, 1, 2, 3 < , 8 0, 1, 4, 9 <<D êê MatrixForm Out[18]//MatrixForm= 00 11 24 39 In[19]:= ? Flatten In[20]:= ? FlattenAt Example 2.4.8 In[21]:= demolist = 8
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/25/2010 for the course PHYS 5900 taught by Professor Lin during the Fall '09 term at East Carolina University .

Page1 / 9

class13 - PHYS 5900 Class 13 (9/23/2009) Zi-Wei Lin...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online