MATLAB: Filter matrix according to column filter matrix i have a matrix 10×60. It consists of entries with the number 0 or 1. I want to filter out all the rows, where the last five columns (55:60) have only 1 and no zero. Best Answer Try this:M = randi([0 1], 10, 60); % Create MatrixM(5, 55:60) = ones(1,6); % Row 5 Meets Criteriarow = all(M(:,55:60) == 1, 2); % Logical Vector, ‘1’ = Meets Criterion For RemovalResult = M(~row,:); Related SolutionsMATLAB: How to vertically concatenate matrices inside a matrix You seem to have nested cell arrays, so perhaps this might work:cellfun(@(a,b)cellfun(@vertcat,a,b,'uni',0),A,B,'uni',0) MATLAB: Concatenation or addition of matrix Try this:Mcat = [M1 M2]; Related QuestionPut number in cellHow to concatenate two or more cell arrays into oneCreating Table from Cell Array DataHow to convert cell to matrixMaking Matrix Dimensions EqualRemoving NaNs columns in matrices within cell array
Best Answer