Merge sorted arrays
Version 1.3.0.0 (8.37 KB) by
Bruno Luong
Given two already sorted arrays, the function combines them in an unique sorted array
Using this function avoids to call Matlab SORT(), which does unnecessary work since the two inputs is already sorted.
Mex implementation for speed.
'rows' option supported
Cite As
Bruno Luong (2025). Merge sorted arrays (https://www.mathworks.com/matlabcentral/fileexchange/28930-merge-sorted-arrays), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2010b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Matrices and Arrays in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired: ChooseK
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.