--- a/matlab/examples/gdf_resample.m
+++ b/matlab/examples/gdf_resample.m
@@ -44,6 +44,10 @@ function gdf_resample( fs_new, inputfile
     
 % 3. fix event positions
 
+    if events.mode == 3
+        events.duration = events.duration * double(fs_new / events.sample_rate);
+    end
+
     events.position = events.position * double(fs_new / events.sample_rate);
     events.sample_rate = fs_new;
     
@@ -92,4 +96,4 @@ function gdf_resample( fs_new, inputfile
     
     gdf_writer( 'clear', handle );
 
-end
\ No newline at end of file
+end
