Table of Tables or cell of Tables
Mostra commenti meno recenti
Hi,
I am preforming machine learning on 13 channels of data and am currently at the feature extraction stage. I have created 13 seperate tables and now which to bring these together into one variable.
I had been trying to create a 1*13 table in which each table element was another table, however I cannot get this to work. I have been able to create a 1*13 cell with each cell element being a table instead. My question is this, is there any benifit to using a tables within cells over tables within tables and vice versa. I will also include some code below, I would like to know how to also make this work for tables within tables too for furture use!
filesTable = array2table(fileNames); % Generate file names to identify each entry
sTruthBuffer = sTruthBuffer';
truthTable = array2table(sTruthBuffer); % Generate ground (clinical) truth
channels = cell(13,1); % generate empty cell for later
for i = 1:13 % For each of the 13 channels
actTable = rows2vars(array2table(act(:,:,i))); % act(ivity) is a 1*2538*13 double
actTable = removevars(actTable,'OriginalVariableNames'); % remove the orignal variale names as junk
actTable.Properties.VariableNames = {'Activity'} % Rename column as something sensible
mobTable = rows2vars(array2table(mob(:,:,i))) % mob(ility) is a 1*2538*13 double
mobTable = removevars( mobTable,'OriginalVariableNames');
mobTable.Properties.VariableNames = {'Mobility'}
complxTable = rows2vars(array2table(complx(:,:,i))) % complx(ity) is a 1*2538*13 double
complxTable = removevars(complxTable,'OriginalVariableNames');
complxTable.Properties.VariableNames = {'Complexity'}
channel = [filesTable,actTable,mobTable,complxTable,truthTable]; % Concatinate all the tables into one table 'channel'
channels{i} = channel ; % for each channel write the generated table 'channel' into a cell array called 'channels',
% this is okay but I think a nested table would be easier to work with?
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Tables in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!