MATLAB: Movie via Frames from Loaded Images

framesimagemovie

I am trying to design a basic visual stimulus (full-field vertical grating with contrast reversal), but am very new to MATLAB. I have created the images I want to use as frames and saved them as jpegs, but when I have tried to use the code to turn these into a movie, I just get a gray screen as my result. If anyone sees what I am doing wrong, I would greatly appreciate any help/guidance.
Here is my code:
reruns = 10;
fps = 4;
nframes = 2;
Frames = moviein(nframes);
load VerticalBars1.jpg
Frames(:,1) = getframe;
load VerticalBars2.jpg
Frames(:,2) = getframe;
movie(Frames, reruns, fps)
Thanks so much in advance for any help you can provide!

Best Answer

Ah, that did seem to help some - thanks! Unfortunately, though, when I repeat the same commands for my second frame (I only have 2 total), the movie I end up with only shows the first frame correctly, and a gray screen for the other. All I changed in my second frame was the file name and the end to "Frames(:,2) = getframe" since I figured the rest of the commands should stay the same. Am I wrong in that assumption, though?