function movieobj = closemovie( movieobj )
%movieobj = closemovie( movieobj )
%   Close a movie, whether it was created with avifile or VideoWriter.

    if strcmp( class(movieobj), 'VideoWriter' )
        close( movieobj );
    else
        movieobj = close( movieobj );
    end
end
