MATLAB: Putting 1 around the matrix putting 1 around the matrix Hi I have a 3X3 matrix and want to put 1 around the matrix as it will become 4X4 matrix….. Best Answer Let A - your matrix [3 x 3]:A = magic(3);out = ones(2 + size(A));out(2:end-1,2:end-1) = A; Related SolutionsMATLAB: “Matrix Dimensions must agree” t is used to build r, but it is not the same length as phi. MATLAB: How to add a column between two columns out = [M1(:,1:2), r, M1(:,3)]; Related QuestionReshape 3d to 2d arrayHow do i find a maximum elements in a specific row
Best Answer