I need, given "n", create a list {a1,a2,...,an}. For example: Given n=3, the list that must be created is composed by the symbolic variables {a1,a2,a3}. Sorry if this question is simple. Does anybody knows how to do it? Thanks.
Answer
For example, for n=5
Table[Symbol["a" <> ToString[i]], {i, 5}]
but consider that in any case it may not be optimal for what you need to do. If you want to share what you are planning to use this list for, we may help you with a better construct.
Comments
Post a Comment