title: Saving mixed data cell array to ascii file in MATLAB
body: <p>I get some data from an instrument that is formatted in a specific way. I need to load the data into MATLAB, manipulate some values, then save it back  with the same format to load back into the instrument software for further analysis...</p>
  
  <p>The issue I am having is the data is of mixed value types and they are kind of all over the place. </p>
  
  <p>The file is tab delimited, I have added arrows eg <code>--&gt;</code> to show the location of the tabs (like notepad++ does)</p>
  
  <pre><code>Scan-42/01
  Temperature [K] :--&gt;   295.00
  Time [s]        :--&gt;     60
  
  "Linspace"
  0.01--&gt;   0.96
  0.02--&gt;   0.95
  0.03--&gt;   0.95
  
  "Logspace"
  0.01--&gt;   0.96
  0.02--&gt;   0.95
  0.04--&gt;   0.94
  </code></pre>
  
  <p>The data keeps going down but I have cut it off after 3 rows.</p>
  
  <p>The data I need to manipulate will be the <code>Temperature</code>, and some of the values under <code>Linspace</code> and <code>Logspace</code>.</p>
  
  <p>I am currently importing the data like this:</p>
  
  <pre><code>filename = 'test.asc';
  delimiter = '\t';
  formatSpec = '%s%s%[^\n\r]';
  fileID = fopen(filename,'r');
  dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'ReturnOnError', false);
  </code></pre>
  
  <p>Data in MATLAB looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/w8HFr.png" alt=".asc file loaded into MATLAB"></p>
  
  <p>Even if I could set up some kind of template in MATLAB where I could get the values nesessary, and then save them in excactly this format would work fine. The file must be saved as .asc, or the instrument will reject it.</p>
  
  <p>Help is greatly appreciated.</p>
  
  <p>Thanks</p>