
Originally Posted by
CaptainBlack
Start by defining a variable to be the universal gravitational constant:
>G= .... ; % replace .... by the value in your notes or from Google
Now define a variable to hold the mass of the moon in kg:
>MM= .... ; % replace .... by the value from your notes or from Google
Now define a variable to hold the mass of the Earth in kg:
>ME= .... ; % replace .... by the value from your notes or from Google
set up an array with the distances you want:
>R=linspace(3.8e8,4.0e8,10);
Now use the appropriate equation to calculate the gravitational force:
>F=(G*MM*ME)./R.^2
CB