- Add an Axes component to the UI, which will be used to plot the images.
- Create a private property named ‘Timer’.
- Add a ‘startupFcn’ callback for the app. This callback will define the properties of the ‘timer’ object and call the ‘updateImage’ function at regular intervals.
- Add the ‘updateImage’ function as a private method.
- Finally, add the ‘UIFigureCloseRequest’ callback to the app to stop the timer when the app is closed.