This shows a MATLAB script to simulate/animate the motion of a double pendulum.
It is interesting that the script includes the MATLAB function 'dxdt' defining the state equation (first-order vector differential equation) to be solved using a differential equation solver 'ode45()'.
The MATLAB code is in the comment by @WonYYAng below.
Ещё видео!