SUNY Geneseo Department of Mathematics
Friday, September 11
Math 230 01
Fall 2015
Prof. Doug Baldwin
%
and also %{ … %}
% How far can you drive on a given amount of gas.
gas = 12; % Available gas in gallons
mpg = 25;
miles = gas * mpg
% Force of gravity between 2 masses
% F = G m1 m2 / d^2
%% Define constants
G = 6.67e-11;
%% Set up a light person on the moon
m1 = 50;
m2 = 7.34767309e22;
d = 1737400;
%% Set up a normal-weight person on Earth
m1 = 60;
m2 = 5.97219e24;
d = 6.38e6;
%% Calculate force
F = G * m1 * m2 / d^2
%%
comment, can be run individually by putting the cursor in it
and then clicking the “Run Section” toolbar button