How can give an user writing permission to a Matlab folder?

Running a home version as a common user I face the following problem: When I want to save a new function to a Matlab folder e.g. toolbox, I get the message, that I have no writing permission to the folder. How can I give as an administrator full access for the common user

1 Comment

Klaus - I don't think that you want to be saving your own (or the user's) new functions to the toolbox directories. You should keep your software separate from that which is built-in (or included with) MATLAB.

Sign in to comment.

 Accepted Answer

You should never be doing that as a "common user". You should only be writing under the MATLAB installation area in one of two circumstances:
  1. You are installing a patch provided by Mathworks; or
  2. You are installing a third party toolbox that is written to expect to be installed under the MATLAB installation directories.
Both of those are administrative functions, not "common user" functions.
But if you insist...
If you are running under OS-X or Linux, start a terminal application (outside of MATLAB), and cd to the directory you want to grant access to, and use
sudo chmod o+rwx .
This will allow anyone to read and write that directory. If "anyone" is too broad, then you need to use any extended security features your OS may provide such as OS-X's chmod ACL options.
If you are running under MS Windows, then then the way to do it is to downgrade to Windows 7 and turn off UAC; https://social.technet.microsoft.com/Forums/windows/en-US/7b3ada32-181d-4c55-9259-ee44f5f83b82/cant-write-to-program-files-folder?forum=w8itprogeneral . If you are using Windows 8 or later, you would need to hack the operating system.
To state this more firmly: In Windows 7 or later, this is not something imposed by MATLAB, this is an operating system restriction, so to get around it you are going to need to alter your operating system.

3 Comments

Maybe I screwed up something, because I am new to MatLab. Under normal circumstances I am always locked in as a common user and so I write functions /programs. Are going to tell me, that I should my Matlab functions in a directory outside Matlab?
Files you create should always be saved outside the directory MATLAB is installed in.
I agree with Walter and Geoff. I keep my MATLAB files under a folder called "D:\MATLAB\work" in a second internal SSD drive. Then I use "Set Path" on the home tab to add that folder to my search path. I keep my startup.m in that folder and all my other projects in subfolders of that folder. There is no permission issue with writing to that folder since it's just an ordinary folder - nothing special. If you're running Windows, Windows won't let you store anything under the Program Files folder without asking for confirmation or throwing an error. Same for certain other folders, like c:\users.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!