I am relatively new to programming. So please bear with me.
plot(i, ex, xlim=c(0,l), ylim=c(0,15), type="o",
xlab="Current position", ylab="Current State of charge"
This is the code I formulated for the plot inside a for loop. But the above code produces an animation of the points on the plot and not a continuous segment (i.e.) the previous points on the plot are erased after each iteration.
Can someone please help me form a continuous series of points on a single plot.
Thank you in advance.