but_delete_Callback.m 707 Bytes
function but_delete_Callback(hObject, eventdata, handles)

global S

I0    = str2num(handles.edit_I0.String);
If    = str2num(handles.edit_If.String);

%% Cut this data from the S raw structure
S.lon(I0:If)  = [];
S.lat(I0:If)  = [];
S.dnum(I0:If) = [];

% write to logfile
newN = numel(S.dnum) ; % track size
fprintf(handles.logfid,'%s,%d,%d,%f,%d\n','delete',I0,If,nan,newN) ;

%% Update plots zooming out
N                      = numel(S.dnum) ;
I0                     = 1 ;
If                     = N ;
handles.edit_I0.String = '1' ;
handles.edit_If.String = num2str(N) ;

guidata(hObject, handles);
update_plots(hObject, eventdata, handles) ;

% Update handles structure
guidata(hObject, handles);

end