MATLAB: I keep getting an error when trying to run the following command from the MATLAB Fundamentals class (pg 6-11 in course notes). Doesn’t writetable overwrite a file if it already exists

MATLABwritetable error

writetable(standings,'EPLstandings.xlsx')
Error using writetable (line 121) Unable to save the workbook to file 'C:\EPLstandings.xlsx'. Check that write permissions are available, there is sufficient disk space, and the file can be written to or created.

Best Answer

  • Try the following solution that worked for people with same issue:
    After creating the two above-named folders, the MATLAB script's writetable() call now correctly creates the .xlsx file.
    You have to create a folder (or two on a 64bit-windows):
    (32Bit, always)
    C:\Windows\System32\config\systemprofile\Desktop
    (64Bit)
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    After creating the two above-named folders, the MATLAB script's writetable() call now correctly creates the .xlsx file.