function [SelectedIndex,flag]=checkBlankTimePoint(h,timeValue,option)
SelectedIndex=[1:length(timeValue)];
flag=true;
if iscell(timeValue)
    if sum(cellfun('isempty',timeValue))>0 || sum(isnan(cell2mat(timeValue(cellfun('isclass',timeValue,'double')))))>0
        ButtonBlank=questdlg('The time vector contains blank time points.  Do you want to remove all the blank points ?', ...
        'Time Series Tools', 'Remove', ...
        'Abort',...
        'Remove');
        drawnow;
        switch ButtonBlank
            case 'Remove'
                ;
            case 'Abort'                    
                SelectedIndex=[];
                flag=false;
                return;
        end
        tmpIndex=find(cellfun('isclass',timeValue,'double')==1);
        tmpIndex=tmpIndex(isnan(cell2mat(timeValue(tmpIndex))));
        timeValue(tmpIndex)={''};
        if strcmp(option,'column');
            SelectedIndex=~cellfun('isempty',timeValue);
        else
            SelectedIndex=~cellfun('isempty',timeValue);
        end
        flag=true;
    end
elseif isnumeric(timeValue)
    if sum(isnan(timeValue))>0
        ButtonBlank=questdlg('The time vector contains blank time points.  Do you want to remove all the blank points ?', ...
        'Time Series Tools', 'Remove', ...
        'Abort',...
        'Remove');
        drawnow;
        switch ButtonBlank
            case 'Remove'
                ;
            case 'Abort'                    
                SelectedIndex=[];
                flag=false;
                return;
        end
        if strcmp(option,'column');
            SelectedIndex=~isempty(timeValue);
        else
            SelectedIndex=~isempty(timeValue);
        end
        flag=true;
    end
elseif ischar(timeValue) && isvector(timeValue)
    SelectedIndex=1;
end
