Hi,
You can try either of the following or both of the following as both would result in preventing the lag or delay in the video as it progresses.
1) You are trying to store images in the axes, since function image() is used.Try inserting a "cla('reset')" just before and see if that speeds it up. Otherwise you may be loading all of the images in there instead of replacing them.
2) Also, you have used "hold on" and haven't used "hold off" because of which all of the images are loaded to the same axes everytime and slows down as video progresses. Try using "hold off" function in the loop.
For more info on hold off function you can visit the links:
Hope it helps !