MATLAB: Error writing “file.m” Acess is denied message when I try to save or run a script.

access denied saving

Hi,
I am currently working with a Matlab script. However, when I try to save it or run it I get the message "access is denied" and nothing happens. My chosen path is a folder on my desktop, NOT Program Files and when I type "cd" in the command window the current directory is my desktop. I have also allowed the Matlab.exe file through Windows Defender.
Does anyone know how to fix this? I have an exam in 10 days that requires me to use Matlab.

Best Answer

Disabling anti-virus might resolve the issue.