Table of Variables
You almost have found a simple solution: try x[i]
instead of x[[i]]
Solve[{x[1] + x[2] == 2, x[1] - x[2] == 1}, {x[1], x[2]}]
{{x[1] -> 3/2, x[2] -> 1/2}}
List of this variables:
Array[x,2]
{x[1], x[2]}
Use Symbol
to convert a string into a symbol...
Table[Symbol["$x" <> ToString@i], {i, 5}]
{$x1, $x2, $x3, $x4, $x5}
One word of caution. I tend to keep programmatically generated variables prepended with a $
to avoid any collisions with any other variables I might've defined. Just from experience.