You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: movieSelectorGUI.m
    path of file: ./repos/u-shape3D/software
    
    the code of the file until where you have to start completion: function varargout = movieSelectorGUI(varargin)
% MOVIESELECTORGUI M-file for movieSelectorGUI.fig

    
function refreshDisplay(hObject, eventdata, handles)

userData = get(handles.figure1,'UserData');

% Display Movie or Images information
if ~isempty(userData.ImD)
    if ~isempty(userData.MD)
        msg = sprintf('Both movie and images are loaded! Please only load one type of data!');
        errordlg(msg, 'Movie/Image error','modal');
        return
    else
        imagePaths = arrayfun(@getFullPath,userData.ImD,'Unif',false);
        nImageData= numel(userData.ImD);
        iImageData = get(handles.listbox_movie, 'Value');
        if isempty(userData.ImD),
            iImageData=0;
        else
            iImageData=max(1,min(iImageData,nImageData));
        end