# [SOLVED] Matlab Help

• Jan 27th 2010, 07:22 PM
lvelazquez83
[SOLVED] Matlab Help
I am really struggling with how to use matlab. If anyone could help me with using the software i would greatly appreciate it.

The problem i am trying to solve using matlab is as follows:
Find the force the moon exerts on the earth for 10 distances between 3.8 x 10^8m and 4.0 x 10^8m.

If anyone can walk me through some steps it would be very helpful! i have tried and tried but i can not figure this out. thanks in advance!
• Jan 27th 2010, 11:20 PM
CaptainBlack
Quote:

Originally Posted by lvelazquez83
I am really struggling with how to use matlab. If anyone could help me with using the software i would greatly appreciate it.

The problem i am trying to solve using matlab is as follows:
Find the force the moon exerts on the earth for 10 distances between 3.8 x 10^8m and 4.0 x 10^8m.

If anyone can walk me through some steps it would be very helpful! i have tried and tried but i can not figure this out. thanks in advance!

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
• Jan 28th 2010, 03:36 AM
lvelazquez83
Quote:

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

THIS WAS OF GREAT HELP! thank you very much!