The function refinepeaks is used in pulsedetection.m, but this function was only introduced in MATLAB R2024b.
Currently, if a user runs the code with an older MATLAB release, it will throw an error since refinepeaksis not available.
Proposed solution:
Add a version check before calling refinepeaks. If MATLAB is older than R2025a, either:
- Provide a fallback implementation
- Display a clear error message indicating the required MATLAB version.