MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Search for Rows to Delete


You also can search for observations in the table. For example, delete rows for any
patients under the age of 30.


toDelete = Tnew.Age < 30;
Tnew(toDelete,:) = [];
size(Tnew)


ans = 1×2


85 7


The table now has 17 fewer rows.


See Also


array2table | cell2table | readtable | struct2table | table


Related Examples



  • “Add, Delete, and Rearrange Table Variables” on page 9-18

  • “Clean Messy and Missing Data in Tables” on page 9-27


See Also
Free download pdf