Hi,
I'm trying to animate a double pendule with matlab.
I looked at this tutorial but didnt manage to make it work : https://fr.mathworks.com/help/symbolic/animation-and-solution-of-double-pendulum.html
function double_pendule(x,y,L1,L2) x1 = @(t) L1*sin(y(t)); y1 = @(t) -L1 * cos(y(t)); x2 = @(t) x1 + L2*sin(y(t)); y2 = @(t) y1 - L2*cos(y(t)); M1 = 1; fanimator(@(t) plot(x1(t),y1(t),'ro','MarkerSize',M1*10,'MarkerFaceColor','r')); axis equal; end
y looks like this :
What did i do wrong ? Thanks !
Best Answer