To play back the image sequences like a video and overwrite the files into a consistent naming format (Image1.jpg, Image2.jpg, ..., ImageN.jpg), you can make some adjustments to your MATLAB code.
To play the image sequences like a video, you can use a loop along with the ‘imshow’ function and a short pause to simulate the video playback and to save the images with a consistent naming format (Image1.jpg, Image2.jpg, ..., ImageN.jpg), you can modify the loop where you save the frames. When constructing the filename, ensure that the frame index (i) starts from 1 and increments in the way you desire.
For more information, you can refer to the documentation link below: