How do I join the data points?

1 view (last 30 days)
Kevin Tran
Kevin Tran on 29 Oct 2015
Answered: Walter Roberson on 29 Oct 2015
Hi,
I am given a problem where I have to plot the orbit of a function cos(x). I want to join the data points so that a line goes through each point.
Here is my code:
function cos_orbit(x, N)
for i = 1:N
y = cos(x);
hold on
plot(i, x, 'b.')
x = y;
hold off
end

Answers (1)

Walter Roberson
Walter Roberson on 29 Oct 2015
Calculate everything first and plot() it later.

Categories

Find more on Earth and Planetary Science 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!