mercredi 8 avril 2015

Automatically increment filename VideoWriter MATLAB

I have MATLAB set to record three webcams at the same time. I want to capture and save each feed to a file and automatically increment it the file name, it will be replaced by experiment_0001.avi, followed by experiment_0002.avi, etc.


My code looks like this at the moment



set(vid1,'LoggingMode','disk');
set(vid2,'LoggingMode','disk');

avi1 = VideoWriter('X:\ABC\Data Collection\Presentations\Correct\ExperimentA_002.AVI');
avi2 = VideoWriter('X:\ABC\Data Collection\Presentations\Correct\ExperimentB_002.AVI');
set(vid1,'DiskLogger',avi1);
set(vid2,'DiskLogger',avi2);


and I am incrementing the 002 each time.


Any thoughts on how to implement this efficiently?


Thanks.


Aucun commentaire:

Enregistrer un commentaire