Question: confused on how to do this please help a) Modify the code from Task 1 (copied below) so that the calculation is repeated 500 times.
a) Modify the code from Task 1 (copied below) so that the calculation is repeated 500 times. Save the number of spin-up electrons computed each time the calculation is repeated in a vector called trials. Hint, you will need to create another loop for the number of times you want to run the code and should end up with a vector called trials of length 500. N_elec = 100; N_up = 0; p=0.5; for h = 1:N_elec x=rand; if x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
