% For this problem, we will use the 'short' scientific... % We are given in the statement of the problem... format

advertisement
% For this problem, we will use the 'short' scientific notation format
format short e
% We are given in the statement of the problem that the rod has a length of
% 2 meters, so we set L = 2
L = 2;
% We are also given that the rod is travelling with a velocity v = 5000 m/s
v = 5000;
% Moreover, the problems tells us to use c = 300 x 10^6 for the speed of
% light
c = 300e6;
% Now we can compute the contraction, by entering its formula (without a
% semicolon, so the value displays when we run the script)
delta = L * (1 - sqrt(1 - (v^2 / c^2)));
% Finally, we display the value of delta by referencing it by name
delta
delta =
2.7778e-10
Published with MATLAB® R2014a
1
Download