MATLAB: How to delete rows that contain NaN in a table

table

Hello all,
So how do you delete all the rows that contain NaNs in a table (not a matrix or a cell array)? I have tried various versions of
tableA(~any(~isnan(tableA), 2),:)=[];
but none work.
Thank you

Best Answer

If the table uses default missing values for the various types (see documentation for the various types; NaN is for numeric) then
tableA=tableA(~any(ismissing(tableA),2),:);
should do the trick. This will eliminate other variables that are missing besides numeric, too, of course, leaving only a complete table.