- Use readtable to read in the data as table T.
- Use the conversion below.
- Write to csv using writetable
How can I export the below table?
6 views (last 30 days)
Show older comments
How can I export the below table?

Data = load('INPUTFILEedit.mat');
DataName = fieldnames(Data);
for k = 1:numel(DataName)
ThisName = DataName{k};
ThisData = Data.(ThisName);
tst=ThisData.Date(1:height(ThisData(2:end,2))); % just a sample set to play with
mydates = datetime(tst,'InputFormat','yyyy-MM-dd''T''HH:mm:ss.SSSSSSSSSZ ', ...
'TimeZone','Europe/London','Format','y-MM')
% size(AUDCAD)
0 Comments
Answers (1)
Adam Danz
on 7 Feb 2021
Edited: Adam Danz
on 9 Feb 2021
T = array2table(reshape(1:18,3,[])', 'VariableNames',{'a' 'b' 'c'},'RowNames', compose('%d',0:5))
T2 = array2table([reshape(T{1:3,:},1,[]); reshape(T{4:6,:},1,[])], ...
'VariableNames', strcat(repelem(T.Properties.VariableNames,1,3), 's', compose('%d',repmat(1:3,1,3))), ...
'RowNames', {'1','2'})
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!