Continuing on from my previous post, Bouncing Ball Animation, here's another great example of using animation to illustrate mathematical concepts. In this example by Mehmet, a Fourier series is illustrated using circles. The first animation shows the first few terms individually, and the second animation shows the sum of the terms.
I have one suggestion for improvement in his code. In order to create the animation, Mehmet re-plots the graphics inside a for-loop. A more efficient, and recommended, way is to plot once and only update the X and Y data of the graphics objects inside the loop.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.