2

Hello I am trying to add some Java classes to the Matlab classpath.txt.

But when I do edit([matlabroot '\toolbox\local\classpath.txt']) I can open a read only file because I do not have root permissions from writing /usr/local/matlab.

Is there a way to do it without root permissions?

1 Answer 1

3

You can do it taking into account these two facts:

  • By default, Matlab probably has your user folder as part of the path (check typing path in the command window).
  • Matlab executes the file matlabrc.m on startup. That script, among other things, looks for another script called startup.m and, if it exists, executes it (see matlabrc documentation).

So: create a file called startup.m (if it doesn't already exist) in your user folder, and that file will get executed on startup. You can do the adding of Java classes there.

Sign up to request clarification or add additional context in comments.

1 Comment

Note that you can determine your user folder with the userpath command. For example, you could open startup.m in the editor with the following command, edit(fullfile(regexp(userpath,'^[^;]*','match','once'),'startup.m')).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.