MATLAB: How to arrange an array in an ascending way

array

Hello MATLAB users,
If there are two arrays: a=[5 8 14 15 17 19 22 23 26 31 34 35 36 39]; and b=[25 30 34 42];, how can I create an array c including the mixture of a and b but arranged in an ascending way?
Thanks so much, Mehdi

Best Answer

Hi, if they are row vectors as you have indicated
c = sort([a b],'ascend');