Extracting data from a table
Afficher commentaires plus anciens
I have a table with multiple variables most of which are numerical. I have one variable which is categorical, I would like to be able to extract all the data relating to the specific variable.
For example my categories are REST, EXERCISE and RECOVERY. The data is split into 22 different variables (of which the phase is column 20) and I would like to create a table with only the REST data in it.
Currently, the data belongs to 'TestTable' which is a 130x22 table (the number of rows in the table will vary depending on the data set).
Any suggestions would be greatly appreciated, and as simple as possible please!
Réponse acceptée
Plus de réponses (1)
Pawel Ladosz
le 15 Août 2016
Modifié(e) : Pawel Ladosz
le 15 Août 2016
Hi Teresa, to get the REST Column from the table the command would look something like this:
A = TestTable{:,{'REST'}}
Or
A = TestTable.REST
Let me know if any of those worked for you.
2 commentaires
Guillaume
le 15 Août 2016
If I understood correctly, 'REST' is not a variable of the table, but one of the categories of the 'PHASE' variable.
Pawel Ladosz
le 15 Août 2016
Yes I think you are correct, I misunderstood the question.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!