remove variables except for prespecified variables from a table

16 vues (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 15 Août 2021
Commenté : alpedhuez le 15 Août 2021
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?

Réponse acceptée

Walter Roberson
Walter Roberson le 15 Août 2021
newtable = T(:,{'Date', 'Visitors'});

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by