MATLAB: Combining 2 vectors matrixvectors Sorry if bit of a silly question but how would i combine 2 vectors as below? Thanks in advance a1 [ 1,2,3,4,5,6] a2 [ 7,8,9,10,11] a3 = [1,2,3,4,5,6,7,8,9,10,11] Best Answer You created a1 asa1 = [1,2,3,4,5,6];and a2 asa2 = [7,8,9,10,11];So why would you not be able to create a3 asa3 = [a1,a2];TRY IT! Related SolutionsMATLAB: Please help me how to describe a matrix in terms of smaller matrices. Is it sure they overlap by one line/column? Then it's just A=[A11 A12(:,2:end);A21(2:end,:) A22(2:end,2:end)]; MATLAB: Sum all the elements two matrices Try thisA = [0 1; 2 3];B = [4 5; 6 7];A_ = repelem(A, size(B,1), size(B,2));B_ = repmat(B, size(A));C = A_ + B_;Result>> CC = 4 5 5 6 6 7 7 8 6 7 7 8 8 9 9 10 Related QuestionRe-sizing vectorsMatrix multiplication using a for loopHow to rearrange the output variables for matlabFunction()
Best Answer