2

I've installed Matlab on my Ubuntu 18.04. Every time I want to open it I need to call it.

/usr/local/MATLAB/R2017a/bin/matlab

I think it is too long and waste of a little time. There has to be an easier way to open it. How can I open it simply by writing its name or is there any easier way?

1
  • 1
    You can add it to "path", or create an alias. – Pilot6 Mar 16 '19 at 9:09
2

Add this to your ~/.bashrc file

export PATH=/usr/local/MATLAB/R2017a/bin:$PATH
1
  • 3
    It didn't work at first, but a little research on the net solved it. It should be without "matlab" at the end. Like this: export PATH=/usr/local/MATLAB/R2017a/bin:$PATH – sarp Mar 16 '19 at 9:27
2

You can either add /usr/local/MATLAB/R2017a/bin/ to your PATH or create another script in a proper directory of executables in your home.

To do the second one follow the steps below.

  1. Create a folder named bin in your home directory. (Note: This assumes the directory ~/bin/ is included in your PATH. If it isn't, you need to add it to your path first.)
  2. Create a text file named matlab (the command you want to use) in the the aforementioned crated folder (i.e. in ~/bin/).
  3. Add the following lines to the matlab file

    #!/bin/bash
    /usr/local/MATLAB/R2017a/bin/matlab
    
  4. Save the matlab file and make it executable.
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.