Exporting excell from matlab

조회 수: 3 (최근 30일)
Cem Eren Aslan
Cem Eren Aslan 2023년 6월 2일
댓글: Dyuman Joshi 2023년 6월 3일
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개)

카테고리

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