I am not able to get a line to appear on my graph?
1 view (last 30 days)
Show older comments
Rachel Bauer
on 16 Sep 2018
Commented: 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
Accepted Answer
Image Analyst
on 16 Sep 2018
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);
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!