Turn tables in a loop into a single cell array

1 visualización (últimos 30 días)
Isabelle Museck
Isabelle Museck el 17 de Sept. de 2024
Comentada: Star Strider el 18 de Sept. de 2024
Hello there I have a loop that extracts data from 10 trials and stores it in (63x541) tables named "OPALData1". I am trying to get the data into 10x1 cell with each (63x541 double) from each trial in each of the cells as shown in IMU_table. I am not sure how to do this? Any suggestons or help would greatly appreciated!
for k = 1:numel(OPALData)
F = fullfile(OPALData(k).folder,OPALData(k).name);
% Import the data
OPALData1 = readtable(F, opts);
OPALData1(1,:) = []
end
%Not sure how to get all of these seperate tables into one cell arrary!!

Respuesta aceptada

Star Strider
Star Strider el 17 de Sept. de 2024
Perhaps something like this —
for k = 1:numel(OPALData)
F = fullfile(OPALData(k).folder,OPALData(k).name);
% Import the data
OPALData1 = readtable(F, opts);
TableCell{k} = OPALData1;
end
Each cell element will be a separate table, as read, all sotred in the ‘TableCell’ cell array. (Name it whatever you want to.)
.
  2 comentarios
Isabelle Museck
Isabelle Museck el 18 de Sept. de 2024
Thank you so much!
Star Strider
Star Strider el 18 de Sept. de 2024
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by