Reading and storing data efficiently - from spreadsheet to cell array

1 vue (au cours des 30 derniers jours)
Pietro Murialdo
Pietro Murialdo le 20 Oct 2019
Hello everybody,
I am wondering what is the most efficient way to read data from a spreadsheet file and store it in the most efficient data structure. The question is general, but I also provide the way I do to welcome any suggestion.
I read data from very long spreadsheet (hundred-of-thousands rows for each sheet), and I need to store only one column for each sheet.
for j = 1:12
Data = readtable(filename, 'Sheet', j+1, 'ReadVariableNames', false);
Data = table2array(Data(:,3));
Data = rmmissing(Data);
filenameOutput = [outputDir, indexName{i}, monthName{j}, '.mat'];
save(filenameOutput, 'Data');
end
What is the most efficient way to do it?
And what about if I want to store the data in a cell format (that is, a N(i)x1 cell where N(i) is the variable length of each column)?
Thank you very much in advance

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by