MATLAB: How to create column names

column names

I have a 1×49 cell array (header_file) that contains the column names of a 1998×49 double data array (data_file). How do I make the 49 values in the header_file be the 49 column names in the data_file?

Best Answer

Can you use a structure instead with fieldnames of the column names?
1. Read the names in as strings.
2. Read the data into an array.
3. Use setfield to assign fieldnames to the structure and set the value to the appropriate column of the array.