function movieobj = addmovieframe( movieobj, frame )
%movieobj = addmovieframe( movieobj )
%   Add a frame to a movie object created by either avifile or VideoWriter.

    if strcmp( class(movieobj), 'VideoWriter' )
        writeVideo( movieobj, frame );
    else
        movieobj = addframe( movieobj, frame );
    end
end
