Well, if they are really called a1 , a2 , etc., you can do this:
Assign[x_, y_] := Module[{s1, s2, n, sn}, s1 = SymbolName[Unevaluated[x]]; s2 = SymbolName[Unevaluated[y]]; For[n = 1, n <= Length[x] && n <= Length[y], n++, sn = ToString[n]; Evaluate[Symbol[s1 <> sn]] = Evaluate[Symbol[s2 <> sn]] ] ] SetAttributes[Assign, HoldAll]
And then
Clear[b1, b2, b3]; Clear[a1, a2, a3]; a = {a1, a2, a3} b = {b1, b2, b3} Assign[a, b] a
Gives results for a , b and a again as:
{a1, a2, a3} {b1, b2, b3} {b1, b2, b3}
As expected.
In general, you can create expressions like these from the correct use of SymbolName and Symbol , but be careful when evaluating. If I wrote SymbolName[x] (without Unevaluated ), he would interpret it as SymbolName[{a1, a2, a3}] , which is clearly undesirable. Without using Evaluate on Symbol[s1 <> sn] , Mathematica will report that you are trying to reassign the Symbol function.