Commit ce1b9754dc02c15b982fbda2a5de56c98fb0924d

Authored by Jean-Luc Shaw
1 parent e3c57515
Exists in master

Added get median time step function

lib/but_get_time_step_Callback.m 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +function but_get_time_step_Callback(hObject, eventdata, handles)
  2 +
  3 +global S
  4 +
  5 +I0 = str2num(handles.edit_I0.String) ;
  6 +If = str2num(handles.edit_If.String) ;
  7 +
  8 +% get time step and convert to seconds
  9 +t = S.dnum(I0:If) ;
  10 +step = median(diff(t)*24*3600) ;
  11 +
  12 +% update display
  13 +handles.edit_interpolate_step.String = num2str(floor(step)) ;
  14 +handles.edit_get_time_step.String = num2str(floor(step)) ;
  15 +
  16 +% Update handles structure
  17 +guidata(hObject, handles);
  18 +
  19 +end
0 20 \ No newline at end of file
... ...
lib/edit_get_time_step_Callback.m
1 1 function edit_get_time_step_Callback(hObject, eventdata, handles)
2 2  
3   -global S
4   -
5   -I0 = str2num(handles.edit_I0.String) ;
6   -If = str2num(handles.edit_If.String) ;
7   -
8   -% get time step and convert to seconds
9   -t = S.dnum(I0:If) ;
10   -step = median(diff(t)*24*3600) ;
11   -
12   -% update display
13   -handles.edit_interpolate_step.String = num2str(floor(step)) ;
14   -
15   -% Update handles structure
16   -guidata(hObject, handles);
17   -
18 3 end
19 4 \ No newline at end of file
... ...