Hello, I am new to Mathematica and trying to understand how to use it so I hope you will excuse me if this question is too elementary.
After looking at some tutorials and read the book An elementary introduction to Wolfram Language I have seen a large number of examples how to manually fill a List (vector) with values (for example: List[a, b, c, d], Table[x, 10] and so on).
However, when I try to enter the results from a calculation into a List variable I run into problems. It seems that the List variable must have been declared (initiated?) in one way or the other before it works.
In the small example attached I have initiated my List variable (vector1) with null and then I can run the For-loop. In the example below I did not initiate the List variable (vector2) and I receive an error message.
How do I do if I dont know in advance how many elements my variable will contain?
/CKY
Attachments: