image thumbnail


version (1.87 KB) by James Slegers
Output a structure to a .csv file, with column headers


Updated 18 Jun 2013

View License


Output a structure of matrices and cell arrays to a comma delimited file with field names as column headers. A simple method for exporting data structures.

s : any structure composed of one or more matrices and/or cell arrays
fn : file name

Written by James Slegers,

Covered by the BSD License

Cite As

James Slegers (2022). struct2csv (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
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!