Hi Jessica,
I understand that you want to save preloaded videos for later use.
The possible workaround could be:
% Create a cell array to store the loaded movies
movie_All = cell(1, 10);
for i = 1:10
stimFname = imageNames{i};
moviename = stimFname;
movie = LoadMovieIntoTexturesDemo(moviename);
movie_All{i} = movie;
end
% Save the preloaded movies to a MAT file
save('preloaded_movies.mat', 'movie_All');
In this code, a cell array `movie_All` is created to store the loaded movies. Within the loop, assuming that `LoadMovieIntoTexturesDemo(moviename)` is called to load the video, and the result is assigned to the `movie` variable. Then, the `movie` is stored in the corresponding cell of `movie_All`. After the loop, the `movie_All` is saved to a MAT file called 'preloaded_movies.mat' using the `save` function.
Later, when you want to use the preloaded videos, Load the MAT file and access the videos as shown below:
% Load the MAT file
load('preloaded_movies.mat');
% Access and use the preloaded movies
for i = 1:10
movie = movie_All{i};
% Play the movie or perform any other operations
end
By loading the 'preloaded_movies.mat' file, you can access the preloaded videos stored in the `movie_All` variable and use them as needed.
For more details, kindly go through following links: