MATLAB: Selecting records from a matrix subject to a condition matrix manipulation My matrix(M) looks like the data below; how can I pull the records that have a third column greater than or equal to 20? 1 0.4 122 1.3 203 1.2 154 2.1 21 Best Answer M(M(:,3)>=20, :) Related SolutionsMATLAB: SUM of selected elements in Matrix Are you looking for something like thisM = [1 1 2 60; 2 3 2 90; 3 1 3 240; 4 2 3 200; 5 3 3 160];result = splitapply(@sum, M(:,4), M(:,2))Result>> resultresult = 300 200 250 MATLAB: How to reassign matrix if it is greater than some value quickly M = a; M(M<b) = 0;M is your answer. Related QuestionConditionOutput rows of a matrix that meet a certain condition to a text fileSelect string by conditionRemove cell array content matrix with condition: length of element in cell smaller than specific valueHow to truncate this matrixSelect rows given a condition
Best Answer