I have a loop in my code and I want to plot some variables,
In each iteration I plot a new point and I want it to be connected to the previous point.
Here is
I would replace your existing plot line with this one
plot(t(1:i),s(1:i)); hold on;
That will plot all of the points from index 1 until the current index. Then, by removing the 'bo', it'll plot using the default format, which is the line that you desire.
Finally, if you want this to actually be animated on the screen (like a movie), you'll need to add a drawnow command before the end of your loop. You also might want to add a pause(0.25) after the draw, to insert a quarter-second delay so that your eye has a chance to see the newly drawn image before it gets overwritten by the next drawing of the image.