MATLAB: How can i create an endlesse animation of sine wave

animation

hi friends,
how can i write a matlab script wich creates an endeless animation of sine wave whose amplitudes varies from on to zero then from zero to one and so on. The frequency of the sine wave is 10Hz, th length of the time support for the plot must be one seconde, and i should try different pause times.
thanks in advance.

Best Answer

You would adjust the parameters at the very top of the code, and you would change the "for" to produce values for H0 instead of H1, and you would comment out the assignment of H1 into f()