remove variables except for prespecified variables from a table

16 ビュー (過去 30 日間)
alpedhuez
alpedhuez 2021 年 8 月 15 日
コメント済み: alpedhuez 2021 年 8 月 15 日
Suppose I have a table T with the set of variables
Date Location Visitors Purchases Item1 Item2 Item3 ...
I just want to keep variables
Date Visitors
and remove the rest of varibles. One can use removevars function but need to write down all variables that will be deleted. Is there any simpler way?

採用された回答

Walter Roberson
Walter Roberson 2021 年 8 月 15 日
newtable = T(:,{'Date', 'Visitors'});

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by