I am trying to get an animated line to plot on an already formatted figure. Simplified code below:
axis ([0 10000 0 10]);
title('my plot', 12);
myline1 = animatedline('Color', 'r');
a = 0;
b = 1000000;
x1 = somevalue;
y1 = someothervalue;
set(0, 'CurrentFigure', 1);
addpoints(myline1, x1, y1)
a = a+1;
However what I'm getting from this is a nicely formatted figure with the axis titles and the range of values but empty of data points, and the animatedline plotting in another figure window. How can I get the animated line to plot onto the existing figure with the required formatting?
The code outputs the correct values for x1 and y1, it's just the plot that I'm struggling with.
Apologies if I'm missing the obvious, this is the first time I've used Matlab in nearly 20 years. Trying to relearn!
Would appreciate any advice.