If the option to show M and MDL-file descriptions is turned on in the current directory section of the user’s preferences, the MATLAB desktop will temporarily lock the files in the current directory to obtain these file descriptions. If the save event for the model file occurs at the same time, then the user can receive the permission denied error.
To workaround this issue, please try unchecking the option 'Show M and MDL file Descriptions' in MATLAB File menu -> Preferences -> Current Directory.
Best Answer