export cell2table to excel

1 vue (au cours des 30 derniers jours)
ramez sabra
ramez sabra le 17 Mai 2019
Modifié(e) : ramez sabra le 28 Mai 2019
Hi, how do I export contents of a cell2table to an excel sheet? do i need to convert to a table first before i can export to excel??
I get the following error statement with my code below. (line 177 is the writable line in the code below)
Undefined function 'write' for input arguments of type 'cell'.
Error in writetable (line 124)
write(a,filename,varargin{:})
Error in data_summary_dat (line 177)
writetable(Summary, filename)
Summary{i,:} = cell2table(data, 'VariableNames', columNames);
xlswrite(filename, Summary)
winopen(filename)

Réponses (1)

Peter Perkins
Peter Perkins le 20 Mai 2019
cell2table is a unction that converts a cell array to 1 table. writetable is a function that writes a table to a file.
This
Summary{i,:} = cell2table(...
suggests that you are (maybe???) creating a table by converting a 1-row cell array and assigning to a row of a table? Maybe? There have to be better ways to do whatever it is that you are doing. A short complete simple example would perhaps make it more clear.
  1 commentaire
ramez sabra
ramez sabra le 22 Mai 2019
thank you for the follow up.
basically i have a set of files, the set "data" extracts parameters from every file (file name, average of a signal, etc.).
Summary is my table, it takes the inofrmation in every iterration of data and stores it in a table row.
finally i do writetable to export "Summary" to excel.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by