rmprop
从表或时间表中删除自定义属性
说明
从表或时间表中删除包含自定义元数据的属性。输入参量 T2 = rmprop(T1,propertyNames)propertyNames 指定属性的名称。
示例
将包含自定义元数据的属性添加到表中。然后删除一些属性。
首先,将湿度和空气质量的测量值读入表中。
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
⋮
使用 addprop 函数为自定义元数据添加属性。然后为这些属性指定元数据。
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]
要删除属性,请使用 rmprop 函数。您只能删除您之前使用 addprop 添加的自定义属性。您不能删除 T.Properties 中的其他属性,但可以删除它们包含的值。
从 T.Properties.CustomProperties 中删除 Instrument 和 SourceFile 属性。
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]
输出参量
删除了属性的输出表,以表或时间表形式返回。
版本历史记录
在 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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)