필터 지우기
필터 지우기

How to Write Table to Excel with headers

조회 수: 22 (최근 30일)
Samantha Brand
Samantha Brand 2015년 6월 3일
댓글: Samantha Brand 2015년 6월 5일
Hello. I need to write a table from within matlab to an excel sheet. Right now, this is the code I have:
writetable(Check_AirTemp, filename, 'Sheet', 3)
Where the table being inputted has columns and rows. I am looking to the best way to add column headers in excel for each of the three columns in the Check_AirTemp table.
  댓글 수: 2
Peter Perkins
Peter Perkins 2015년 6월 3일
Samantha, writetable (unless you tell it otherwise) does write the variable names as column headers in the spreadsheet. What headers are you looking for?
Samantha Brand
Samantha Brand 2015년 6월 5일
I'm looking for column headers, not just the variable name (which I already have as the title of the columns) what is the best function for that.

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

답변 (1개)

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015년 6월 3일
Hi Samantha,
I usually use xlswrite() which then I add the headers as soon as I generate the file.
You can give it a try if you like, I haven't heard of writetable() in fact!
  댓글 수: 2
Image Analyst
Image Analyst 2015년 6월 3일
Tables and the associated functions like readtable() and writetable() came about in release R2013b I believe.
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015년 6월 3일
편집: Salaheddin Hosseinzadeh 2015년 6월 3일
Alright!
I am using 2012a and it does not have writetable.
Thanks Image Analyst ;)

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

카테고리

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