%% Table with Multiple Data Types
% Remove incomplete rows from a table with multiple data types.
% First, create a table whose variables include categorical, double, and char data types.

A = table(categorical({'';'F';'M'}),[45;32;NaN],{'';'CA';'MA'},[6051;7234;NaN],...
    'VariableNames',{'Gender' 'Age' 'State' 'ID'})

%
% Remove any row of the table that contains missing data.

R = rmmissing(A)

%
% Only remove rows with missing values in the Age or ID table variables.

R = rmmissing(A,'DataVariables',{'Age','ID'})

%
% Alternatively, use the isnumeric function to identify the numeric variables to operate on.

R = rmmissing(A,'DataVariables',@isnumeric)

% Copyright 2012 The MathWorks, Inc.