I'm using the code below to animate a line for the purpose of a presentation. It seems that the 'animatedline' function doesn't support the option of changing color over the course of the plot (e.g., in a manner that scales with X, Y or Z). It seems that the 'patch' function supports this, and I'm wondering if there's a way to do something similar with 'animatedline'? Any help from the Matlab experts?
%X, Y and Z were emperically determined from a separate analysis, and are pre-assigned
view([-12 34])curve = animatedline('Color','r','LineWidth',3);numpoints = size(x)ax = gca;axTickDir = 'out'ax.FontSize = 11;ax.XLim = [0 11];ax.YLim = [1 5];ax.ZLim = [1.5 3] for k=1:numpoints addpoints(curve,x(k),y(k),z(k)); pause(0.05) M(k) = getframe(gcf); enddrawnow
Best Answer