MATLAB: Cutting rows and columns from a matrix matrix manipulation If A = [0,0,0,0;0,0,0,0;0,0,1,1;0,0,1,1], how can i cut out the null comumns and rows to acheive B = [1,1;1,1] Best Answer See ANY (or ALL). You need a two step approach:A = [1 0 1 0 ; 1 0 1 0 ; 0 0 0 0]B = A(any(A,2),:) ; % remove null rowsB = B(:,any(A,1)) % remove null columns Related SolutionsMATLAB: Changing Matrix value at odd position of row with reference to a certain column A=[0 0 0 0 00 0 0 0 00 0 0 0 01 1 1 0 01 1 1 0 01 0 0 0 01 0 0 0 01 0 0 0 01 0 0 0 01 0 0 0 01 0 0 0 01 0 0 0 01 0 0 0 01 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0 0];B = zeros(size(A));B(:,1) = ismember(A,[1,1,1,0,0],'rows');orB = zeros(size(A));B(:,1) = sum(A,2) > 1; MATLAB: Signal cutting Thanks Walter, but that's not the point, every third period has different power, and I need to remove it. Related QuestionHow to place a cell array in another cell array using ‘find’How to remove rows and columns from two matricesFprintf cutting off stringLogical operation on column of a matrixCutting area plot matlabHow to remove certain rows and columns in a matrixTwo planes cutting each other
Best Answer