MatchArrays

Matches two sorted one-dimensional arrays, with the output Nan-Matched

You are now following this Submission

This function "matches" two one-dimensional arrays together. The result is a 2-column matrix, where each row of the matrix contains the original elements of each array. If the arrays do not match each other at a certain index, then in the resulting matrix the array not containing that value will contain a NaN at that row. Each one-dimensional array should be sorted before passing it to this function.
For example, the input arrays [1 2 3 3 3 4 5] and [1 2 3 5 6 7] will be matched to look as follows: [1 2 3 3 3 4 5 nan nan; 1 nan 3 3 nan nan 5 6 7].

Cite As

David (2026). MatchArrays (https://in.mathworks.com/matlabcentral/fileexchange/56501-matcharrays), 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