Our goal here is to write MATLAB code that will create a time-lapse video. Let's suppose that we want our video to capture frames overnight that is start shooting when we want it to and then shoot 1 frame every minute, for 8 consecutive hours. This will lead to a video comprising 8 x 60 frames, which is 480 frames in total. An uncompressed video with a resolution of 720 x 576 pixels and 8-bits depth per color channel will require approximately 598 MB. Therefore, you should make sure that you have at least 598 MB of RAM available to save it.
It goes without saying, that your camera must be plugged to the power outlet so that we don't face battery problems. If you work with a laptop, it should be plugged in as well. Let's start using MATLAB as an intervalometer: