diff --git a/matlab/step_length_correction.m b/matlab/step_length_correction.m
new file mode 100644
index 0000000000000000000000000000000000000000..7334aa2d6e9044a604a8c6552f22359725c815f5
--- /dev/null
+++ b/matlab/step_length_correction.m
@@ -0,0 +1,6 @@
+function c = step_length_correction(x,scale,i)
+    if isempty(scale)
+        c = 10^round(log10(abs(x)));
+    else
+        c = scale(i);
+    end
\ No newline at end of file