How do I create a cell array inside a loop?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a Nx1 cell array of tables called 'T' and I am looking to extarct the variables in each table but the size of 'T' can vary as can the dimensions of the tables. My code is below.
I know this can be done in a for loop using something along the lines of - for i = 1:length(data)... but how do I write the part that can create a new vars number array to hold the VariableNames in?
vars1 = T{1}.Properties.VariableNames;
vars2 = T{2}.Properties.VariableNames;
vars3 = T{3}.Properties.VariableNames;
...
...
...
varsX = T{N}.Properties.VariableNames;
Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!