rmprop
table または timetable からカスタム プロパティを削除
説明
T = rmprop(
は、カスタム メタデータを含むプロパティを table または timetable T
,propertyNames
)T
から削除します。入力引数 propertyNames
はプロパティの名前を指定します。
例
カスタム メタデータを含むプロパティを table に追加します。次に、一部のプロパティを削除します。
まず、湿度と大気質の測定値を table に読み取ります。最初の 3 行を表示します。
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.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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)