MATLAB: Run many iterations of a code

helpiterationloop

Best Answer

Here's a template
n = 1000; %number of iterations
Team_1_Prediction = zeros(1,n); %here's where we'll store the output of each iteratoin
% loop through each iteration
for i = 1:n
mushot = [randi(100,Team1Shots,1)];
% [insert the rest of your code here]
Team_1_Prediction(i) = mupoints - usmpoints; % <-- store value of i_th iteration
end