This simple MATLAB code solves ODE system for seismic ray tracing:
For a review and simple derivation of ray tracing equations please see ray_tracing_equations.pdf.
The original code is in Python developed by Matteo Ravasi as teaching material for ErSE 210 Seismology course at KAUST can be found in: