Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'list manipulation ?' topicStudent Support Forum > General > "list manipulation ?"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
07/07/13 8:35pm

In[1]:= list1 = {{a, b, c, d, e, f, g}, {a, b, c, d, e, f, g}, {a, b, c, d, e, f, g}, {a, b, c, d, e, f, g}, {a, b, c, d, e, f, g}};
list2 = {{p}, {p}, {p}, {p}, {p}};
f[v1_, v2_] := Join[{First[v1]}, v2, Drop[v1, 4]];
MapThread[f, {list1, list2}]

Out[4]= {{a, p, e, f, g}, {a, p, e, f, g}, {a, p, e, f, g}, {a, p, e, f, g}, {a, p, e, f, g}}

URL: ,

Subject (listing for 'list manipulation ?')
Author Date Posted
list manipulation ? augustus 07/07/13 10:32am
Re: list manipulation ? Bill Simpson 07/07/13 8:35pm
Re: list manipulation ? Peter Pein 07/08/13 04:46am
Re: list manipulation ? augustus 07/08/13 12:50pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic