Few points I need to mention:
1) You are calculating R1_av as a function of u, so if you use the below chunk of code, it will plot the values of R1_av.
plot(1:p, R1_av, 'linewidth', 1.5); hold on; grid on;
2) I am amaze that why you wish to plot R1_av as a function of d1. d1 is Distances of users from base station. You are using the same variable in line 3 and line 6. Never do that. Never assign the pre assigned variable in a loop iterated variable, as it is not a good practice and hard to debug the code.