rmprop
从表或时间表中删除自定义属性
说明
T = rmprop( 从表或时间表 T,propertyNames)T 中删除包含自定义元数据的属性。输入参量 propertyNames 指定属性的名称。
示例
将包含自定义元数据的属性添加到表中。然后删除一些属性。
首先,将湿度和空气质量的测量值读入表中。显示前三行。
T = readtable('indoors.csv');
head(T,3) 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
使用 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.Propertiesans =
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.Propertiesans =
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)