MATLAB: Merging Arrays in Ascending Order

arrayfor loopmergeswap

Hello, I am new to matlab. I have this problem. I have to merge two or more arrays into a new array in ascending order for example
The size of the new array will be equal to the sum of all the input arrays.
INPUT :
a = [1 2 3 5 6 8 9 ]
b = [4 7 10 15 17 20 ]
c = [11 12 13 14 16 18 19]
OUTPUT:
d = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]

Best Answer

Hello my friend, I'm new too.
I guess you can use:
d = [a b c]
then sort:
d_sort = sort (d)
Related Question