MATLAB: How to get rid of the error like “unable to create new file you may not have permission ” on the current folder

file permissiontext file

how to get rid of the error like "unable to create new file you may not have permission " on my current folder?

Best Answer

  • cd to a different folder, or
  • use your operating system facilities to give yourself permission to write into that folder, or
  • in Windows, Run As Administrator. For Linux and Mac, using sudo to run MATLAB is not equivalent, because sudo will change your user identity and MATLAB will say that you are not an authorized user, or
  • if your directory is underneath where programs are installed in Windows then there is a way to disable that Windows protection feature
Of these, only cd to a different directory is recommended, but there are cases where sometimes adjusting the security settings is the necessary solution.