Getting Error while saving the File_name.m can anyone help why i am getting this?

while saving file after making changes in the code i am getting the following error shown in the image. Please guide me whats wrong with the simulator?

3 Comments

Have you changed the working directory? Are you trying to save as or save?
No i haven't change the Directory you can see the path in the image. I am currently using bin folder to save .m files
" I am currently using bin folder to save .m files"
Do NOT store any of your own files in any .bin folder, or anywhere under Program Files or its 64 bit equivalents.
Change the directories you use to store any files to your user directory.

Sign in to comment.

 Accepted Answer

You need admin privileges to modify or save files inside Matlab's program directory. It is strongly recommended not to touch any files in this installation directory. Use your own folder instead to store your M-files, e.g. in the user's documents folder.

3 Comments

In case this answer is not clear enough:
Do NOT save any files to the Program Files directories
Or for that matter to any other directory where programs are installed.
Your Current Directory should NOT be under the Program Files root.
Your Current Directory is usually be under the User root...
Well that's quiet confusing. How to change the path? the files run from the bin folder.
the files run from the bin folder
I thought Stephen was clear enough. You should never store your own m files in any directory under C:\Program Files\.
For several versions now, Windows has had built in protection to prevent you saving files there as it's very easy to render your installation unusable. This built-in protection is the cause of the error you're seeing.
Traditionally, your files are saved under MyDocuments\Matlab, in your user directory.
To return to your user directory:
cd(userpath)

Sign in to comment.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Asked:

on 5 Aug 2018

Commented:

on 6 Aug 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!