Setting default MATLAB directory under Linux

조회 수: 10 (최근 30일)
Henrik
Henrik 2011년 1월 21일
I am running MATLAB R2010a under Ubuntu Linux 10.04.1. In the documentation you can read that in Linux, the working directory on startup will be set to the directory from which you started MATLAB. However, by setting the environment variable MATLAB_USE_USERPATH to 1, MATLAB should start up from the default user path, as given by issuing the command userpath from MATLAB. Now, my problem is that this does not work. I am setting the environment variable at the Linux command prompt through "export MATLAB_USE_USERPATH=1" and then starting up MATLAB from the same shell. But I still end up in the wrong directory! Can anyone tell me what might be wrong?
  댓글 수: 3
Henrik
Henrik 2011년 1월 21일
Hi Todd. These commands returned the expected values, i.e. 1 and the correct startup directory, respectively. However, I think I managed to solve the problem by resetting the user path, userpath('reset'). So now it works!
Henrik
Henrik 2011년 1월 21일
My mistake. It didn't solve the issue! The functions you refer to above still return the expected values.

댓글을 달려면 로그인하십시오.

답변 (1개)

the cyclist
the cyclist 2011년 1월 23일
It's been a long time since I've called MATLAB from the command line, but a different approach than what you are trying is to use the "-r" option to issue a command upon startup. You could use that to take you to the directory you want. Not sure how kludgy that might be for you.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by