How can I store tables object in an array?

15 Ansichten (letzte 30 Tage)
Ryan Pond
Ryan Pond am 1 Mai 2018
Beantwortet: Guillaume am 1 Mai 2018
My raw data is a variable number of xy data sets (my current data has 10 sets of xy data). Each data set has a different size but the same type of data. I am performing the same function on each set. Currently I am explicitly creating a table name for each one and then repeating the same operation on each. It would be much easier if I can store all the tables in an array and loop through it.
I enjoy the convenience of referencing the data by column name..

Akzeptierte Antwort

Guillaume
Guillaume am 1 Mai 2018
Option 1 is to store your tables into a cell array. You can then use explicit loops or cellfun to apply the same code to each table.
However, considering that each table have the same columns, the option I would chose would be to concatenate all the tables vertically into one, with an additional column indicating which original table each row came from. varfun or rowfun with the 'GroupingVariables' option using that column would allow to apply functions on each original data set.

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by