You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
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)
Cite As
Keith Brady (2026). CSV with column headers (https://www.mathworks.com/matlabcentral/fileexchange/29933-csv-with-column-headers), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (1.75 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
