If I were you, I would have used vlc player to merge videos....it is straight forward to merge videos in vlc.
https://wiki.videolan.org/How_to_Merge_and_Transcode_Multiple_Videos/
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!