image thumbnail

csv header and file reader

version (2.95 KB) by Derek Bassett
Read a csv file and assign columns to variable names based on header strings.


Updated 19 Aug 2013

View License

This function reads a csv file where the first line is a header for variable names, and the subsequent lines are numerical data. It will assign the data in each column to a specific variable based on the text in the header on the first line. Input requires two cell lists: one for the header strings in the 1st line of the csv file, and another for the field names to assign them to in the output structure.

Cite As

Derek Bassett (2022). csv header and file reader (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!