title: Invoke Error, Dispatch Exception:
body: <p>I'm trying to write a cell array and I'm using these line of codes:</p>
  
  <pre><code>[filename,pathname] = uiputfile('.xlsx','choose your file');
  fileToWrite = fullfile(pathname,filename);
  fileID = fopen(fileToWrite,'w');
  **xlswrite(fileToWrite,cellul);**
  fclose(fileID);
  </code></pre>
  
  <p>I receive this error at the bold line</p>
  
  <p>??? Error using ==> xlswrite at 213
  Invoke Error, Dispatch Exception:
  Source: Microsoft Office Excel
  Description: Excel cannot open the file 'eee.xlsx' because the file format or file extension is not valid.
  Verify that the file has not been corrupted and that the file extension matches the format of the file.</p>