MATLAB: I am not able to get a line to appear on the graph

graph

clear all;
radius = 6378:50000; force = (3.986e5/(6378.^2));
figure plot(radius,force); axis([0 50e3 0 10]) xlabel('r(km)'); ylabel('F(m/s)');

Best Answer

You had force just as one single number, not a list of forces for each radius. Try this:
radius = 6378:50000;
force = 3.986e5 ./ (radius .^ 2);
figure
plot(radius,force, 'b-', 'LineWidth', 2);
% axis([0 50e3 0 10])
xlabel('r(km)');
ylabel('F(m/s)');
grid on;
title('force vs. radius', 'FontSize', 20);