table

Methods

Method Reference: table.rmprop

table: T = rmprop (T, propertyNames)

Remove custom properties from a table.

T = rmprop (T, propertyNames) removes properties that contain custom metadata from the table T. The input argument propertyNames specifies the names of the custom properties to be removed and it can either be a character vector, a cell array of character vectors, or a string array. Names that do not match any existing custom property are silently ignored.

Source Code: table

Example: 1

rmprop removes custom properties previously added with addprop, whatever their scope. Here a table starts with one property of each kind.

 Age = [38; 43];
 Gender = categorical ({'M'; 'F'});
 T = table (Age, Gender)
T =
  2x2 table

    Age    Gender    
    ___    ______    

     38         M    
     43         F
 T = addprop (T, {'DataSource', 'Instrument'}, {'table', 'variable'});
 T.Properties.CustomProperties.DataSource = 'Clinic A';
 T.Properties.CustomProperties.Instrument = {'form', 'form'};
 T.Properties.CustomProperties
ans =

  scalar structure containing the fields:

    DataSource = Clinic A
    Instrument =
    {
      [1,1] = form
      [1,2] = form
    }

Remove the variable-scoped Instrument; the table-scoped DataSource remains. The built-in properties (names, units, ...) are never affected.

 T = rmprop (T, 'Instrument');
 T.Properties.CustomProperties
ans =

  scalar structure containing the fields:

    DataSource = Clinic A