I would like to reuse the data received through RandomInteger, without writing the data again. Is it possible?
Try SeedRandom. From the RandomInteger documentation:
Thanks a lot, Hans!!
I have an assignment where I am supposed to calculate various things concerning a vector. First I am to find three randomly chosen numbers that define my vector, using RandomInteger. After that I am to save the vector values (a, b, c) using “new commandos”, (in order for me not to randomly chose another set of numbers). (Quite obviously, I am not supposted to type in the three values again, even if that seems like an easy thing to do). Followingly, I used the SeedRandom commando, that you so kindly suggested. Nevertheless, as I continue to do my assignment, I do not manage to make Mathematica call for my vectors’ values when using other commandos such as:
Norm[]
Dot[]
ArcCos[]
Graphics3D[{Arrow[{{0, 0, 0}, {a, b, c}}],
Arrow[{{0, 0, 0}, {32, -140, -55}}]}]
Do you have any idea of what I might be doing wrong?
/Ă…sa
Does the code below work for you?
SeedRandom[4]
vector = RandomInteger[{-10, 10}, 3]
Graphics3D[Arrow[{{0, 0, 0}, vector}]]
Hans,
I am really happy with the result! Thank you again!!!
/Ă…sa
