Error writing name_file.m. Access denied.
Ältere Kommentare anzeigen
Hi everyone, I have a sudden problem when I try to save or run the file. The error window say "Error writing name_file.m. Access denied". It's really strange because it has always worked well. I tryed to:
- Change path location
- Open Matlab as administrator
- Change Matlab version from 2016 to 2018
- Change Matlab file
But i have always the same problem. I can not understand what the problem could be. This is the screenshot:

6 Kommentare
Geoff Hayes
am 15 Feb. 2019
michele - is it only this file that is causing the problem or is it others? have you tried saving the file to a different folder? what are the permissions on the file (read only or read/write)?
michele paoletti
am 15 Feb. 2019
Brent Vanhul
am 18 Feb. 2019
Bearbeitet: Brent Vanhul
am 18 Feb. 2019
I have exactly the same error message and tried the same as listed. I firstly encountered the problem 11 Feb 2019 and now I'am not able to write to,save or create any file/folder anywhere on my C drive by using matlab (Windows 10 Version 1803).
pwd: 'C:\Users\vanhu\Documents\MATLAB\...'
Matlab installed: 'C:\Program Files\MATLAB\R2018b'
I checked the permissions for all the different groups and users for the pwd and everyone has: modify, read & execute, list folder contents, read, write.
michele paoletti
am 18 Feb. 2019
Mehul Mulay
am 27 Sep. 2021
Hi!
I have faced a similar problem on MacOS.
Please let me know the solution..
Andy Mendez Cuello
am 15 Sep. 2022
Hi.
I have a Windows 10 Pro, I had the same problem and in the end it was for safety issues for applications control, I gave him to allow change in Matlab and I stopped giving me that mistake.
Greetings.
Akzeptierte Antwort
Weitere Antworten (3)
Supratim Shit
am 9 Mai 2019
10 Stimmen
You are facing this issue becasue of a feature called controlled folder access in Windows 10. It helps you protect valuable data from malicious apps and threats, such as ransomware.
You need to go to Settings > Update & Security > Windows Security > Virus and Threat protection > Manage Ransomware Protection > Allow an app through controlled folder access > Add your application
10 Kommentare
Jaisal Chauhan
am 27 Mär. 2020
Bearbeitet: Jaisal Chauhan
am 27 Mär. 2020
thank you, man! You have saved my life with this answer, because I was able to save my experimetal results at the last moment for a project that i had to submit!
I don't know how you found out such a detailed intricate reason behind the issue, but kudos!
Hassan Kianmehr
am 17 Jul. 2020
Just login to say thank you!
Mehdi Hatami
am 19 Aug. 2020
Thank you man For this great and valuable help you have given me!
Zhao Lu
am 1 Mär. 2021
Very great and valuable answer !!
yagmur gedik
am 2 Mär. 2021
thank you very much
Brijesh Shah
am 16 Aug. 2021
Thank you very much
shubhashree bal
am 20 Aug. 2021
This worked.
Thank you!
FELIPE ANANGANÓ LEIME
am 13 Jan. 2022
perfect, thank you!!!
Kevin Tapia Pantoja
am 4 Aug. 2022
This is the right answer, I was working well until I activated the Ransomware protection but I just didn't allow Matlab. Thank you
johnny ramone
am 30 Jun. 2023
After almost a year sundelly the Ransomware protection blocked matlab, just go to recently block app and allow it. Thank you <3
Pruthvi Muppavarapu
am 18 Feb. 2019
1 Stimme
Disabling the anti-virus might help resolve the issue.
If you are using Windows Defender; an exclusion may need to be made for MATLAB. This can be done in Windows 10 by following the steps mentioned in the link:
1 Kommentar
michele paoletti
am 11 Mär. 2019
Pratibha Dimri
am 24 Mai 2021
0 Stimmen
what worked for me was :
first go to search bar on windows-type matlab-run as admin
Kategorien
Mehr zu Share and Distribute Software finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

