未定义的函数或变量'mmreader'

时间:2017-08-27 02:32:00

标签: matlab

我尝试使用matlab 2016a来阅读avi视频,但是,我遇到了以下问题:

undefined funciton或变量'mmreader'; 代码如下:

clc;
clear;
%% this to read avi by using mmread to get every frame
video = mmreader('D:\My Documents\MATLAB\My\fire.avi');
nFrames = video.NumberOfFrames;
H = video.Height;
W = video.Width;
Rate = video.FrameRate;
% Preallocate movie structure.
mov(1:nFrames) = struct('cdata',zeros(H,W,3,'uint8'),'colormap',[]);


%read one frame every time
for i = 1:nFrames
mov(i).cdata = read(video,i);
P = mov(i).cdata;
 disp('current frame number:'),disp(i);
 imshow(P),title('original picture');


%     P2=rgb2gray(P);

end

为什么呢?谁能帮助我?提前谢谢。

1 个答案:

答案 0 :(得分:1)

在版本R2010b中不推荐使用函数mmreader,在版本R2014a中删除了函数while,并在版本R2015b中将其从文档中删除。它被VideoReader函数取代,因此请使用它。

相关问题