Exporting excell from matlab

2 次查看(过去 30 天)
Hi all,
I want to export a cell as Exell file from MatLab. How can i do that?
Thx

采纳的回答

Kautuk Raj
Kautuk Raj 2023-6-3
To export a cell array as an Excel file from MATLAB, we can use the writetable function. This is an example which demonstrates how to do this:
% Create a sample cell array
myCell = {'Name', 'Age', 'Gender'; 'John', 25, 'Male'; 'Mary', 30, 'Female'};
% Convert the cell array to a table
myTable = cell2table(myCell(2:end,:), 'VariableNames', myCell(1,:));
% Write the table to an Excel file
writetable(myTable, 'myExcelFile.xlsx', 'Sheet', 1);
  1 个评论
Dyuman Joshi
Dyuman Joshi 2023-6-3
Why convert cell to table when you can directly write it to an excel file?

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by