In this blog post I am going to show you how to install MATLAB on linux in a step by step procedure.
Step-1: Create an account on mathworks.com
visit mathworks & click on signin & if you scroll down you see an option to create account click on that. If you are exploring this for yourself, select Personal & select Student if you are a student. If you are uncertain about what to choose, just select Personal.
Fill all the details & confirm your email. Open your mail & click the confirmation link.
After the confirmation, go ahead and signin to your account. And remember if you didn’t receive any email, click on send the email again link, sometimes the link doesn’t appear right away.
Step-2: Purchasing MATLAB
Let me guide you on what to buy, especially for someone getting started with MATAB. Mathworks offer you huge range of products in toolbox forms and it will be confusing to choose the right product for you. I will show you where to shop first. If you login to your account, you see Products link, click on it & you will be show a list of MATLAB products.
Click on Student use & this will land you into purchase page for student version of MATLAB, as you can see the below screenshot you have two options,
- MATLAB student & SIMULINK for 49 USD
- MATLAB for 23 USD
Which one to choose?
Always go for MATLAB & SIMULINK because it packs all the basic toolboxes, if you go for MATLAB only which is 23 USD, then for additional toolboxes, you need to buy it separately.
Click on buy for 49 USD, & this will load the product list page for the selected package with all the details and if you want to buy additional products you will have to purchase them separately anytime after you install this or if you wish to purchase it now, you can select from the listed items. As you can see that the page provides a comprehensive list of all the products that comes along with the purchase, go ahead the click add to cart at the bottom, accept the terms & conditions, then provide your billing address & check to pay using visa/master/american express debit or credit card.
Once the download is complete, you can see download & install it. If the download pop up didn’t come up, you can click on my-account and you can observe your license number & from here you can click on the download icon.
Step-3: Download & install
First of all, make sure that you are connected to the internet. Accept the terms & conditions and you will be asked to login to your account. Give your mathworks credentials & click on next & next until you are asked to install. Finally, after clicking on install, the process will take about few minutes.
Also, if you already had a previous version of matlab please make sure to delete it, because multiple profiles can cause errors during the startup, I mentioned about the issue & how to fix it at the bottom. For linux users, you can simple override the matlab installation.
Extract the zip file using winrar or equivalent software for windows users & for linux users do it using unzip. From the extracted files, a binary called install can be found. Execute it to install it.
./install
Accept the license agreement.
Login to your mathworks account.
Select your license.
Always go with the default installation directory.
And if everything went well, you will have the below window with Activation complete message.
Finally, you can now launch your MATLAB from command line using the command,
./matlab
note: Make sure to use right hostid while activating the MATLAB, other wise you will run into this error, “License checkout failed. Invalid host. License Manager Error -9”
Above all, the important thing is, you need to delete existing profiles if any from .matlab directory especially when you run into such problem.
cd ~/.matlab rm *
Your hostID for matlab will be your computer name, in my case its “root”
Free alternatives
If you think that MATLAB is too expensive, there is a free open source alternative; you can try Octave! Please click here to know more about it.