Looks like the following is relevant:
How do I concatenate two MX arrays in a MEX-file that emulates the HORZCAT command of MATLAB? http://www.mathworks.com/support/solutions/en/data/1-2V66G9/index.html
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!