Jump to content

what is the problem with this matlab code?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
onqun

onqun

    Newbie

  • Members
  • Pip
  • 4 posts
function playMovie(filename)

obj = mmreader(filename);
vidFrames = read(obj);
numFrames = get(obj, 'numberOfFrames');
% reading each frame
for k=1:numFrames
    img(k).cdata = vidFrames(:,:,:,k);
    img(k).colormap = [];
end
 % Playing the movie
movie(img, obj.FrameRate);

% displying a move frame
%f = fix(numFrames/2);
%imagesc(img(f).cdata);

for m=1:numFrames
    z=img(m).cdata-img(m+1).cdata;
    z(numFrames)
end

end
Hello guys, this code hopefully will subtract the image from the previous one. This code gives an error at the very beginning, while the function suppose the ask me a video file it gives an error. I could not understand why.
Thank you for help

Edited by WingedPanther, 30 March 2009 - 03:12 AM.
add code tags (the # button)


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I don't think we have any matlab programmers on the forum. That said, have you used output statements to isolate which line is causing the problem?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog