title: MATLAB Save Cell Arrays to NetCDF File
body: <p>I have a .csv file that I've imported into MATLAB using the import data function as column vectors. Each column in the .csv file is now a cell array of size 7286x1. How can I save each of these column vectors as a variable into a netcdf file?</p>
  
  <pre><code>ncid = netcdf.create('WI_O3.nc', 'NOCLOBBER');
  dimid = netcdf.defDim(ncid, 'my_dim', 7286);
  SiteID = netcdf.defVar(ncid, 'AQS_SITE_ID', 'double', dimid);
  netcdf.endDef(ncid);
  netcdf.putVar(ncid, SiteID, AQS_SITE_ID);
      % Error using netcdf.putVar (line 56)
      % Expected DATA to be one of these types:
      % 
      % double, single, uint8, uint16, uint32,
      % uint64, int8, int16, int32, int64, char
      % 
      % Instead its type was cell.
  </code></pre>
  
  <p>How can I convert all my cells to a string or double or whatever that would make it work? Some of my cells are composed of words (strings) while others are numbers (double)</p>
  
  <p>Is there a faster way to just save all of the variables in the workspace into one .nc file (keeping all the variable names the same is fine)?</p>