linestyle and other properties are global to a line; to have a different style/marker/color/whatever apply to only a single point will require that point be independent of the line. A scatter object would work for it; draw the line irrespective but w/o the marker then update the [X|Y]Data property for the scatter object to show the one point.
ADDENDUM
To do this all with HG2, you'd have to create a second animatedline with the desired marker style, color, etc., and then addpoints to its handle each iteration after you clearpoints the previous point of that handle; that appears to me likely to be more overhead intensive than the scatter solution suggested that just updates a single data array point albeit it mixes old and new styles...
Unfortunately, I am at R2012b which predates all this stuff so can't actually test here but there's not a method documented with animatedline to just modify a data point as you're needing to do here...
To illustrate, my solution would be sotoo--
hAL = animatedline;
hAL.LineStyle='-';
hAL.Color='blue';
hAx=gca;
sz=10;
clr='b';
hS=scatter(hAx,nan,nan,sz,clr);
x = mmatrix(:,2);
y = mmatrix(:,1);
for k = 1:length(x)
addpoints(hAL,x(k),y(k));
set(hS,'xdata',x(k),'ydata',y(k))
drawnow
end
See the doc's for scatter for other options, details...
Seems like this ability would be a reasonable enhancement request to the animated line going forward...why not submit this query to TMW as such?
Best Answer