Connect with us

Software

How to execute matlab from terminal in Ubuntu (Linux)?

Published

on

How to execute matlab from terminal in Ubuntu (Linux)?

While trying to install Matlab [1], it generally gives an error stating “matlab: command not found.”. Here, we provide a solution to this error.

This error occurs when the Matlab is not in your path. This could be because during installation it was unable to write to the default location, i.e., /usr/local/ and you have installed the Matlab in some other location. Or you have installed Matlab successfully but not added to the path. Let’s go through the solutions for both situations.

1. Running installer with sudo permission

When you run the installer without the sudo permissions (./install), it will not install Matlab in the default location stating “cannot create a folder in /usr/local” or “cannot write to /usr/local/“. You need to provide permissions using the sudo command. But when you try to run the installer with the sudo command then it keeps running without displaying anything.

So, to run the installer with the sudo command, you will first have to allow the root user to access the running X server. Open a terminal (Ctrl+Alt+T) and paste the following command.

$ xhost +SI:localuser:root

Now, you can run the installer with the sudo command as shown below.

$ sudo ./installer

2. Adding to the path

Open the bashrc file.

$ sudo nano ~/.bashrc

Add the following command at the end of the file.

$ export PATH=$PATH:/usr/local/MATLAB/R2022a/bin

Here, R2022a is the Matlab version. Replace it with your installed version.

Save and close the file.

$ source ~/.bashrc

Now, you can type $ matlab in the terminal to run the Matlab.


References

  1. MATLAB. (2022). version 9.12.0 (R2022a). Natick, Massachusetts: The MathWorks Inc.

Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba

Advertisement
Click to comment

You must be logged in to post a comment Login

Leave a Reply

Software

How to install Kpax on Ubuntu (Linux)?

Published

on

How to install Kpax on Ubuntu (Linux)?

Kpax is a bioinformatics program to search and align protein structures [1]. It is currently available for Linux platforms only. In this article, we are going to install the latest version of Kpax (5.1.3) on Ubuntu (Linux). (more…)

Continue Reading

Secondary structure

How to run do_dssp command (mkdssp) in Gromacs 2022?

Published

on

How to run do_dssp command in Gromacs 2022?

In the latest version of GROMACS (2022) [1], there are some issues regarding the gmx do_dssp command. Apparently, this command either does not run displaying a fatal error, or if it runs then it does not read any frame from MD simulation files. In this article, we are going to run the same command for GROMACS 2022. (more…)

Continue Reading

Software

Installing SMINA on Ubuntu (Linux).

Published

on

Installing SMINA on Ubuntu (Linux)

SMINA is a fork of AutoDock Vina supporting better scoring function and high-performance energy minimization [1]. In this article, we are going to install SMINA on Ubuntu (Linux). (more…)

Continue Reading

LATEST ISSUE

ADVERT