The program codes for animation are explained in my previous videos posted in below links. The program structure , approach to solution and animation are similar.
My previous video on animation of series RLC circuit
• #MATLAB/#OCTAVE : Simulation of RLC serie...
My previous video on animation of a simple pendulum
• #MATLAB/#OCTAVE : Animation of a simple ...