title: Matlab - Error using save Cannot create '_' because '_____' does not exist
body: <p>I have some data in a cell array,</p>
  
  <pre><code>data2={[50,1;49,1;26,1];...
      [36,2;12,2;37,2;24,2;47.3,2];}
  </code></pre>
  
  <p>and names in another cell array,</p>
  
  <pre><code>names2={'xxx/01-ab-07c-0fD3/0';'xxx/01-ab-07s-0fD3/6';}
  </code></pre>
  
  <p>I want to extract a subset of the data,</p>
  
  <pre><code>data2_subset=data2{1,:}(:,1);
  </code></pre>
  
  <p>then a temporary file name,</p>
  
  <pre><code>tempname2=char(names2(2));
  </code></pre>
  
  <p>an save the subset to a text file with</p>
  
  <pre><code>save (tempname2, 'data2_subset', '-ASCII');
  </code></pre>
  
  <p>But I get this error message: _</p>
  
  <pre><code>Error using save
  Cannot create '6' because 'xxx/01-ab-07s-0fD3' does not exist.
  </code></pre>
  
  <p>To try to understand what is happening, I created a mock dataset with simpler names:</p>
  
  <pre><code>names={'12-05';'14-03'};
  data={[50,1;29,1;25,1];[35,2;22,2;16,2;38,2];[40,3;32,3;10,3;44,3;43,3];};
  data_subset=data{1,:}(:,1);
  tempname=char(names(2));
  save (tempname, 'data_subset', '-ASCII');
  </code></pre>
  
  <p>in which case the save command works properly.</p>
  
  <p>Unfortunately I still do not understand what the problem is in the first case. Any suggestions as to what is happening, and of possible solutions?</p>