Results 1 to 5 of 5

Thread: How to run matlab under my root directory

  1. #1

    Default How to run matlab under my root directory

    Hello everyone:

    I am a rookie using Linux system.

    Before running the matlab every time, I must go into that directory first, which is usr/local/matlab/r2011a/bin.

    Is there a solution for me so that i can type "./matlab" directly under my root directory which begins with my user name?

    Thanks a lot~

  2. #2
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    1,927

    Default Re: How to run matlab under my root directory

    You can create a symbolic link. Try this command in your home directory:
    Code:
    ln -s /usr/local/matlab/r2011a/bin/matlab
    Verify the link has been created using the ls command and try running matlab the way You wanted.

    Best regards,
    Greg
    Best regards,
    Greg

  3. #3

    Default Re: How to run matlab under my root directory

    Quote Originally Posted by glistwan View Post
    You can create a symbolic link. Try this command in your home directory:
    Code:
    ln -s /usr/local/matlab/r2011a/bin/matlab
    Verify the link has been created using the ls command and try running matlab the way You wanted.

    Best regards,
    Greg
    Thanks very much~~~~~

  4. #4
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    1,927

    Default Re: How to run matlab under my root directory

    No problem. Glad I could help.

    Best regards,
    Greg
    Best regards,
    Greg

  5. #5
    Join Date
    Aug 2008
    Location
    Maryland
    Posts
    208

    Default Re: How to run matlab under my root directory

    If you look at your path, you will see that you have a bin directory. If you put the link there, then all you would have to do is type matlab.

    Code:
    dave@Hagar:~> echo $PATH
    /home/dave/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games
    With a link in your home directory, you need to ensure that is where you are at in order to do ./matlab. Or you would have to use a full path, /home/user/matlab.

    If the program is in a directory that is in your path, you just type its name.

    If you have a .bashrc or .profile in your home directory, you could add the matlab directory to your path instead.

    Code:
    vi .bashrc
    Insert line
     PATH=$PATH:/usr/local/matlab/r2011a/bin/
    Dave W

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •