How to write column headers into Excel files?

18 ビュー (過去 30 日間)
Leon
Leon 2020 年 1 月 27 日
コメント済み: Leon 2020 年 1 月 27 日
I'm trying to generate an Excel file with column headers. Below is my code. Why does the generated file do not containt the column header at all?
File_W = 'Output.xlsx';
col_header={'Depth','Parameter_A'};
xlswrite(File_W, col_header, 'Sheet1', 'B1');
xlswrite(File_W, DATA(:,[1,2]), 'Sheet1', 'B2');
  2 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 1 月 27 日
try using array2table and writetable function.
Leon
Leon 2020 年 1 月 27 日
Many thanks.
writetable works.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by