Code covered by the BSD License  

Highlights from
Merge sorted arrays

4.0

4.0 | 1 rating Rate this file 12 Downloads (last 30 days) File Size: 8.3 KB File ID: #28930

Merge sorted arrays

by Bruno Luong

 

03 Oct 2010 (Updated 31 Oct 2010)

Given two already sorted arrays, the function combines them in an unique sorted array

| Watch this File

File Information
Description

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

Acknowledgements

This file inspired Choose K.

MATLAB release MATLAB 7.11 (R2010b)
Other requirements Mex installed
Tags for This File  
Everyone's Tags
merge, sort(2), sorted, sortrows
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
19 Jan 2012 Jan Simon

@Tal: C++ comments are accepted in the C99 style. Only C89 does not consider them, but this standard is 23 years old now.

28 Mar 2011 Tal Darom

it works.
note that the .c files have c++ comments, resulting in errors when compiled with gcc.

file names should be changed to .cpp or use a c style comments.

Updates
04 Oct 2010

Optionally return the splitting locations of the inputs

31 Oct 2010

Minor speed improvement

Contact us