extract tables from a cell - to Classification Learner
Mostrar comentarios más antiguos
I prepared all the data, in for loop mode, from 20 different sizes tables. Now the tables are inside a cell, each cell position has a different table in it. In order to choose the best model, using the Classification Learner app, I believe I will need to extract each table from the cell and run the Learner for each table one by one (as the Learner does not recognize a cell with many tables), right ? If this is the way to do it, how can I extract all the individual tables from the cell and give each one a different name (preferebly with the names for each one I already have stored in another cell string).
9 comentarios
Adam Danz
el 8 de Ag. de 2019
"how can I extract all the individual tables from the cell "
Why not just loop through each element of the cell array?
Flavio
el 8 de Ag. de 2019
I'm not sure how your code is set up but the idea is to extract the table from each element of the cell array within the loop.
for i = 1:n
t = cell{i}; % t is a table
. . . % <---- your code
end
Flavio
el 9 de Ag. de 2019
"The idea is that the loop extracts, with a couple lines of code, each cell table to a new table with differents names automatically"
Instead, use my example but this time, take a few minutes to think about it. Your code will go within that loop and will act upon each "t" table within the loop.
for i = 1:n
t = cell{i}; % t is a table
% [ your code goes here ]
% [ so you can process each table ]
end
.
Adam Danz
el 9 de Ag. de 2019
Flavio's answer moved here as comment
Thanks. It is not what I expected, But I believe there is no solution other use the for loop as you mentioned to create each of the tables. Therefore each line will be a new letter table that will be generated inside the for loop from the inside table of the cell. Therefore 100 stocks, 100 lines.
tks anyway for your attention
regards
flavio
Adam Danz
el 9 de Ag. de 2019
In your question you asked, "how can I extract all the individual tables from the cell " so there's no need to create the tables in the loop (although you could).
"Therefore each line will be a new letter table that will be generated inside the for loop "
That's not what I'm suggesting. In fact, I strongly advise you not to do that. On each iteration of the loop, the table will be named "t". After you extract the table you can do your processing on "t" within the loop.
Adam Danz
el 9 de Ag. de 2019
I'm glad we finally got there ;)
Respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!