필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to insert index table on XLS

조회 수: 1 (최근 30일)
Maurizio
Maurizio 2011년 10월 28일
마감: MATLAB Answer Bot 2021년 8월 20일
How can I insert a Index table on XLS file?
On matlab I have a matrix with 8colums and 200rows.
I need to insert on the first row of each column the title.
I'm using xlswrite('CO2.xls',A) for exporting the matrix.
Can anybody help me please?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 10월 28일
I can think of two ways. First one is to write twice. The second one is to combine the Header and Data and then write once. See if the first one solves your problem.
Header={'colA','colB','colC'};
Data=rand(20,3);
xlswrite('CO2.xls',Header,1,'A1');
xlswrite('CO2.xls',Data,1,'A2');
  댓글 수: 2
Maurizio
Maurizio 2011년 10월 28일
Header={'D','P','g','o','Fu','Fle','Da'};
xlswrite('CO2.xls',Header,1,'A')
if I write the code above the output xls file has only the header. How can I append also the matrix A after the header?
What are A1 and A2?
Fangjun Jiang
Fangjun Jiang 2011년 10월 28일
Run the code in my answer and you'll see. 'A1','A2' is the starting cell position in the spreadsheet that you want to write the data to. Check the help of xlsread().

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by