MATLAB: How to do matrix addition of different sizes matrix addition E = diag([12:4:56]) B=rand(12,3) C=A+B Best Answer C=AC(:,1:3)=A(:,1:3)+B(:,1:3) Related SolutionsMATLAB: Matrix define using for loop Read about diag. A = -4*ones(9,1) ; B = [1 1 0 1 1 0 1 1] ; C = ones(1,6) ; iwant = diag(C,-3)+ diag(B,-1) + diag(A) +diag(B,1) + diag(C,3) MATLAB: How to create matrix with array under certain conditions B = [ones(1,3)*A(1); A; ones(1,3)*A(1)] Related QuestionEigenvalues corresponds to eigenvectorsHow to get the secondary diagonal of a matrixHow to Assemble the matrix shown in the image on Matlab for any number of nodes
Best Answer