MATLAB: How to concatenate two matrices MATLABmatrix I need to concatenate two matrices x=[ 1 2 3 4]y=[5 6 7 8] such that I get z=[1 5 2 6 3 7 4 8] Best Answer z = [x;y];z = z(:).' Related SolutionsMATLAB: Concatenate This makes the 5x3 that you requested.c1 = {'hello' 'world' 'Happy Tuesday'};c2 = {'Need' 'coffee' 'now'};m1 = magic(3);C = vertcat(c1,c2,num2cell(m1));To make a 3x5 use;C = horzcat(c1',c2',num2cell(m1)); MATLAB: How to get combination of elements in a matrix in pair order A=[3 5 6 7 8];b = nchoosek(A,2)b = 3 5 3 6 3 7 3 8 5 6 5 7 5 8 6 7 6 8 7 8 Related QuestionConcatenateQUESTION ON MATRIX RESHAPINGConcatenate matrixHow to make a 3×3 matrix a 9×1 matrixFind the pair of the matrixConcatenate arrays
Best Answer