rdiff: ratios a la diff

Calculates the ratios of consecutive elements in an array

You are now following this Submission

Essentially, this is the built-in DIFF with subtraction replaced by division.
The sign is preserved for one iteration. I have not checked for it's validity with multiple rdiff's, so a warning is printed for iteration > 1.

See http://www.mathworks.com/help/matlab/ref/diff.html

Cite As

Peter Mao (2026). rdiff: ratios a la diff (https://in.mathworks.com/matlabcentral/fileexchange/59155-rdiff-ratios-a-la-diff), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0