export cell2table to excel

조회 수: 1 (최근 30일)
ramez sabra
ramez sabra 2019년 5월 17일
편집: ramez sabra 2019년 5월 28일
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)

답변 (1개)

Peter Perkins
Peter Perkins 2019년 5월 20일
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
ramez sabra
ramez sabra 2019년 5월 22일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by