subdivide numbers inside a file .xlsx
Show older comments
How can I divide the numbers into different columns in this attached .xlsx file?
filename = 'file.xlsx';
t = readtable(filename);
t(1:6,:)
Accepted Answer
More Answers (2)
Simpler:
C = readcell('file.xlsx');
M = str2double(split(C(6:end),', '))
T = array2table(M, 'VariableNames',split(C(5),', '))
Your data is stored in single cells of the xlsx. For example
-3.55882719e-02, -1.09321419e-02, 8.20557680e-03, 0.00000000e+00, 1.00000292e-01
is stored all as a single cell, not as seperate cells.
format long g
filename = 'file.xlsx';
temp = readcell(filename, 'headerlines', 5);
t = cell2mat(cellfun(@str2num, temp, 'uniform', 0))
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!