0
$\begingroup$

I want to generate a table that gives the following output:

output: {"x1", "x2", "x3", "x4", "x5"}

I have tried:

Table["x"*i, {i, 5}] 

which gives

{"x", 2 "x", 3 "x", 4 "x", 5 "x"}

I wonder what is a correct way of doing this?

$\endgroup$

closed as off-topic by andre314, corey979, Henrik Schumacher, chuy, JungHwan Min Aug 2 '18 at 20:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – andre314, corey979, Henrik Schumacher, chuy, JungHwan Min
If this question can be reworded to fit the rules in the help center, please edit the question.

3
$\begingroup$
Table["x" <> ToString[i], {i, 5}]

{"x1", "x2", "x3", "x4", "x5"}

$\endgroup$
  • $\begingroup$ That was clever, thank you loads gonna accept this :) $\endgroup$ – William Aug 2 '18 at 13:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.