rmprop

Removes a custom property from a table or timetable.

Category: Language Fundamentals > Data Types

Syntax

T2 = rmprop(T, propertyName)

Removes the custom property created earlier with addprop.

Description

Custom properties store metadata, such as units or a description of the source, next to a table. They live in T.Properties.CustomProperties. rmprop deletes one of them; it cannot remove the built-in properties like VariableNames.

Input arguments

T
Table or timetable.
propertyName
Name of a custom property.

Output arguments

T2
Table without that property; the data are untouched.

Example

T = table([1;2], 'VariableNames', {'A'});
T = addprop(T, 'Note', 'table');
T.Properties.CustomProperties.Note = 'raw data';
T.Properties.CustomProperties
T = rmprop(T, 'Note');
T.Properties
Output
ans = struct with fields:

    Note: 'raw data'
ans = struct with fields:

       Description: ''
     VariableNames: {'A'}
          RowNames: {}
    DimensionNames: {'Row'  'Variables'}

See also

addprop table timetable summary