- #1
Mugged
- 104
- 0
[ANSWERED] Mathematica -> making multiple variables in one go?
Ok so let's say i know how many variables i want:
numberofvariables = 5;
and then i want to create 5 different variables, say X1, X2, X3, X4, X5 based on some formula, say:
Xi = 5+i^2
but i want this creation of variables to be done automatically, without me having to explicity type out and declare X1, X2, X3,...separately...
is this possible?
I really need to know, because say i want numberofvariables = 200, it would be a pain to have to separately declare X1 through X200...
thank you so much.
(Note: this is a radically simplified version of what i am doing...there is not need to substitute a different method to solve the above problem, i just need dynamic variable declaration?)
Ok so let's say i know how many variables i want:
numberofvariables = 5;
and then i want to create 5 different variables, say X1, X2, X3, X4, X5 based on some formula, say:
Xi = 5+i^2
but i want this creation of variables to be done automatically, without me having to explicity type out and declare X1, X2, X3,...separately...
is this possible?
I really need to know, because say i want numberofvariables = 200, it would be a pain to have to separately declare X1 through X200...
thank you so much.
(Note: this is a radically simplified version of what i am doing...there is not need to substitute a different method to solve the above problem, i just need dynamic variable declaration?)
Last edited: