- Lack of write access in that location.
- Antivirus software removing files (very unlikely).
- Attempt to create a file in that location to check if you have write access.
- If you have write access, then open MATLAB in Administrator mode.
- If you do not have write access, choose another location where you do have write access.
- If you have antivirus software, try pausing it and then continue with code generation.