CSV with column headers

版本 1.0.0.0 (1.8 KB) 作者: Keith Brady
This simple routine extends the function of the MATLAB csvwrite function to add column headers
9.4K 次下载
更新时间 2011/1/6

查看许可证

I have often needed to generate data files to export from Matlab for other programs with headers to explain the contents of the columns. This simple routine extends the function of the MATLAB csvwrite function to add column headers

Please refer the help for csvwrite for a detailed description of all the parameters but this a simple example of how to use the function:

>> headers = {'A','B','C'}

headers =

'A' 'B' 'C'

>> data = [1,2,3;4,5,6]

data =

1 2 3
4 5 6

>> csvwrite_with_headers('test.csv',data,headers)

引用格式

Keith Brady (2024). CSV with column headers (https://www.mathworks.com/matlabcentral/fileexchange/29933-csv-with-column-headers), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Spreadsheets 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0