How do I write strings and numbers to a excel file

조회 수: 5 (최근 30일)
Anush Lingamoorthy
Anush Lingamoorthy 2017년 7월 12일
편집: Jan 2017년 7월 12일
I am trying to create a .csv or .xlsx file with data and strings. The first row being titles Example output:
Test# Subject Data1 Data2 Data3
Test1 AAA 1 2 3
Test2 BBB 4 5 6
I made a matrix that stores the data in a variable A. Using csvwrite('Temp',A)
A=[1 2 3;4 5 6]
csv file output:
1 2 3
4 5 6
But am unable to add the titles which are stored as strings

답변 (1개)

Jan
Jan 2017년 7월 12일
편집: Jan 2017년 7월 12일
Data = {'Test#', 'Subject', 'Data1', 'Data2', 'Data3'; ...
'Test1', 'AAA', 1, 2, 3; ...
'Test2', 'BBB', 4, 5, 6};
xlswrite('File.xlsx', A);
You find some implementations to store a cell in a CSV file directly in the FileExchange:

카테고리

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