function goAhead = confirmOverwrite( f )
    if exist( f, 'file' )
        answer = questdlg(['File ', f, ' already exists, overwrite?'], ...
                           '', ...
                           'Yes','No','No' );
        goAhead = strcmp(answer,'Yes');
    else
        goAhead = true;
    end
end
