format long g;
R=[10 20 50 100 6370];
for i =1:length(R)
Gravitational_Potential(:,i) = (M*R(:,i));
xlabel('Radius of the Sphere');
title('Gravitational potential vs Radius ');
I have to plot as curve plot as attached
Hint : - consider you have a function y = x^2. And now you have points x=1,2,4,8, from this you can get the corresponding y values: y=1^2,2^2,4^2,8^2. How do you visualize these values?
Now you have the same with a function V=GM/R, and R=10k,… you got V for all these values, you can visualize your results the same way you did above.