This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

rmprop

Remove custom properties from table or timetable

Syntax

T = rmprop(T,propertyNames)

Description

example

T = rmprop(T,propertyNames) removes properties that contain custom metadata from the table or timetable T. The input argument propertyNames specifies the names of the properties.

Examples

collapse all

Add properties that contain custom metadata to a table. Then remove some of the properties.

First, read measurements of humidity and air quality into a table. Display the first three rows.

T = readtable('indoors.csv');
head(T,3)
ans=3×3 table
           Time            Humidity    AirQuality
    ___________________    ________    __________

    2015-11-15 00:00:24       36           80    
    2015-11-15 01:13:35       36           80    
    2015-11-15 02:26:47       37           79    

Add properties for custom metadata using the addprop function. Then assign metadata to those properties.

T = addprop(T,{'Instrument','Precision','SourceFile'},{'variable','variable','table'});
T.Properties.CustomProperties.Instrument = ["clock" "hygrometer" "air quality meter"];
T.Properties.CustomProperties.Precision = [NaN 0.5 0.1];
T.Properties
ans = 
  TableProperties with properties:

             Description: ''
                UserData: []
          DimensionNames: {'Row'  'Variables'}
           VariableNames: {'Time'  'Humidity'  'AirQuality'}
    VariableDescriptions: {}
           VariableUnits: {}
      VariableContinuity: []
                RowNames: {}

   Custom Properties (access using t.Properties.CustomProperties.<name>):
              SourceFile: []
              Instrument: ["clock"    "hygrometer"    "air quality meter"]
               Precision: [NaN 0.5000 0.1000]

To remove properties, use the rmprop function. The only properties that you can remove are the custom properties that you previously added using addprop. You cannot remove the other properties in T.Properties, although you can delete the values they contain.

Remove the Instrument and SourceFile properties from T.Properties.CustomProperties.

T = rmprop(T,{'Instrument','SourceFile'});
T.Properties
ans = 
  TableProperties with properties:

             Description: ''
                UserData: []
          DimensionNames: {'Row'  'Variables'}
           VariableNames: {'Time'  'Humidity'  'AirQuality'}
    VariableDescriptions: {}
           VariableUnits: {}
      VariableContinuity: []
                RowNames: {}

   Custom Properties (access using t.Properties.CustomProperties.<name>):
               Precision: [NaN 0.5000 0.1000]

Input Arguments

collapse all

Input table, specified as a table or timetable.

Names of the custom properties, specified as a character vector, cell array of character vectors, or string array.

Introduced in R2018b