MATLAB Answers

0

I am not able to get a line to appear on my graph?

Asked by Rachel Bauer on 16 Sep 2018
Latest activity Commented on by Rachel Bauer on 17 Sep 2018
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)');

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Image Analyst
on 16 Sep 2018
 Accepted 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);

  1 Comment

Sign in to comment.