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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by