MATLAB: Extract some columns from a matrix MATLABmatrix Suppose I have a matrix A and suppose I want to create a new matrix from 1st, 3rd, and 4th column of A. Is there any compact way to do this? Best Answer B = A(:,[1 3 4]) Related SolutionsMATLAB: Extracting columns from a matrix with a matrix B = randi(10,6,8);A=[0 3 0; 0 2 1];X = num2cell(sum(reshape(B(:,A+1),size(B,1),size(A,1),[]),3),1); MATLAB: Repeat last row at the end of matrix B = [A; A(end,:)] ; Related QuestionExtract numbers from column matrixHow do i extract values from a particular column of in a matrix.How to insert row into matrix
Best Answer