based on a few inputs:
-data acquisition rate
-frame nr. of the input video that corresponds to first datapoint
this script will output the original video (on the left) and in addition will display an animated version of the x,y plot (on the right).
-lets you specify the size of the image relative to the size of the plot
-specify the margins
-lets you rotate the video
-lets you crop to the part of the video you're interested in
Due to the way one makes animated plots in MATLAB - the resolution of the output video will depend on your screen resolution. However, this script is made so that it runs on both Mac OS X and windows, and should work for arbitrary screen resolutions.
For getting a good result one still might need a to fiddle a bit with the exact position of the x/ylabels, but at least one won't have to start from scratch. Let me know if you have suggestions to improve performance / usefulness.
Peter Dieleman (2022). Syncing up Video to Datafile for Animated plot (https://www.mathworks.com/matlabcentral/fileexchange/44636-syncing-up-video-to-datafile-for-animated-plot), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!