%% Create object to read video files
%Replace the file-name accordingly
v = VideoReader("filename.extension");
%% Read all the frames
allFrames = read(v);
%% Number of frames
num = size(allFrames, 4);
%% Write each frame as a jpg file
for k=1:num
name = sprintf('Frame_%d.jpg', k);
imwrite(allFrames(:,:,:,k), name)
end
The format of the images will be according to format of the video - Output argument from read()
For more information, refer to -