rmprop
Remove custom properties from table or timetable
Description
removes properties that contain custom metadata from a table or timetable. The input
argument T2 = rmprop(T1,propertyNames)propertyNames specifies the names of the properties.
Examples
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.
T = readtable("indoors.csv")T=60×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
2015-11-15 03:39:59 37 82
2015-11-15 04:53:11 36 80
2015-11-15 06:06:23 36 80
2015-11-15 07:19:35 36 80
2015-11-15 08:32:47 37 80
2015-11-15 09:45:59 37 79
2015-11-15 10:59:11 36 80
2015-11-15 12:12:23 37 80
2015-11-15 13:25:35 37 79
2015-11-15 14:38:46 36 83
2015-11-15 15:51:58 37 80
2015-11-15 17:05:10 36 80
2015-11-15 18:18:22 37 80
⋮
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'}
VariableTypes: ["datetime" "double" "double"]
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'}
VariableTypes: ["datetime" "double" "double"]
VariableDescriptions: {}
VariableUnits: {}
VariableContinuity: []
RowNames: {}
Custom Properties (access using t.Properties.CustomProperties.<name>):
Precision: [NaN 0.5000 0.1000]
Input Arguments
Input table, specified as a table or timetable.
Names of the custom properties, specified as a string array, character vector, cell
array of character vectors, or pattern
scalar.
Output Arguments
Output table without removed properties, returned as a table or timetable.
Extended Capabilities
The
rmprop function fully supports tall arrays. For more information,
see Tall Arrays.
Version History
Introduced in R2018b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)