%field_in_and_out_of_a_sphere
function field_in_and_out_of_a_sphere
gR = 1;
xin = linspace(0,1,5000);
g = gR*xin;
xout = linspace(1,3,1000);
g = [g,gR./(xout.^2)];
x = [xin,xout];
plot(x,g,'linewidth',1);
grid on;
set(gca,'fontsize',18);
print(gcf,'field_in_and_out_of_a_sphere.png','-dpng','-r600');
close(gcf);