I have a code that involves generating a random number and then the rest of the calculations are based on that number. I want to run this 100x with 100 different random numbers, but obviously I don't want to manually run it and write down the final answer 100 times. Would I use a loop to get it to do this on its own? I am only familiar with writing loops where separate numbers are set for each run, like running a calculation with numbers 1-100 or with pulling out numbers from a vector. I am not sure how I would write one that runs a set number of times and generates a random number each time.
Aucun commentaire:
Enregistrer un commentaire