Matlab how to install linux

Installing MATLAB on Linux

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.

In this article, we will discuss how to install MATLAB in Linux. For installing MATLAB we will first register on Mathswork, and then we will download the software. Let’s discuss this in detail.

How to log in or register on Mathworks: Go to https://in.mathworks.com/login to log in or click create one to register your account using your school or work email address.

Downloading the software

Before downloading you must activate your license and then proceed with the following steps. Go to your account by clicking this link https://in.mathworks.com/mwaccount/. You will see a download option in your active licenses, click on it and select Linux to download the zip file required for installation.

Note: You must also install 7z to extract the zip file.

Installing MATLAB

  • By default, the zip file will be downloaded to the Downloads folder.
  • Create a folder and move the downloaded zip file named matlab_R2021a_glnxa64.zip inside it.
  • Open a terminal inside the folder and enter the following command to extract the zip file.
  • 7z x matlab_R2021a_glnxa64.zip

Now, enter the following command and enter your system password to install MATLAB. sudo ./install

  • A window will open up and will ask you to sign in to your Math works account.
  • Accept the terms of the license agreement and click NEXT.
  • Select the license you have or enter the Activation key if you have any and click NEXT.
  • Type your Linux username in the Login Name text field and click NEXT.
  • Select a destination folder for installation and click NEXT.
  • Select the products you want to install.
  • Enable create symbolic links to MATLAB scripts and select Desktop as your destination.
  • Confirm the selections and begin the installation. NOTE: Your system should be connected to the internet as the setup will download the necessary packages.
  • A Desktop shortcut will be created after installation is complete, open a terminal in desktop and enter ./matlab to start MATLAB Desktop.

Источник

Ubuntu Documentation

Introduction

MATLAB® is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C++, and Fortran.

You can use MATLAB in a wide range of applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. Add-on toolboxes (collections of special-purpose MATLAB functions, available separately) extend the MATLAB environment to solve particular classes of problems in these application areas.

MATLAB provides a number of features for documenting and sharing your work. You can integrate your MATLAB code with other languages and applications, and distribute your MATLAB algorithms and applications.

MATLAB R2014b on Ubuntu 14.04

From ISO

  • First, mount the .iso file of the image with right-click, Open with and select Disk image mounter (if required).
  • Open a terminal and change to the mounted image file. For example:
    • cd /media/username/MATHWORKS_R2014A

From Download

Download the install file from http://www.mathworks.com/downloads/

  • Unzip and open downloaded directoy
  • Install

    • Run the installer as a super user
      • sudo ./install
    • Follow the instructions of the installer and install in /usr/local/MATLAB/R2014a
    • To add an entry to the launcher and some other features, install the matlab-support package:
      • sudo apt-get install matlab-support
    • During the installation you have to confirm the installation path of matlab and could restrict the installation only to certain users (which I did not require). In addition you could rename the GCC libraries, but I had no problems so far so I didn’t deactivate those.
    • After completion, you have to change the ownership of the .matlab folder in the home folder to your own user account if you do not want to run Matlab as a super user.
      • sudo chown username -R

        Now Matlab should also be launchable through unity and should work as intended.

        MATLAB R2012a

        Important Note Regarding Ubuntu 12.04

        MATLAB R2012a was released on March 1, 2012. Please note that this is prior to the release of Ubuntu 12.04. Consequently Ubuntu 12.04 is not a supported operating system for MATLAB R2012a as it can be seen in the MATLAB Roadmap.

        MATLAB R2012a users are strongly encouraged to install R2012a on Ubuntu 10.04 LTS or Ubuntu 10.10 for best results. Help for the installation of MATLAB R2012a on Ubuntu 12.04 will however be given through this tutorial.

        Important Note Regarding Student version (32-bit)

        Unfortunately, 32-bit is the only version available to students.

        If you have a 64-bit system, you will have some trouble but it is normally possible to go through each of them and the details are in the Troubleshooting section.

        The following helps you be a length ahead of these problem. If you have a 64-bit system, you can still install 32-bit version of MATLAB. However, you will need to install the «ia32-libs» package before the installation. If you have Ubuntu 13.10 or later, check out this thread for more information.

        Once it is installed, run the installer with the -glnx86 argument to force it to use 32-bit

        Though for R2012a it is not necessary anymore. If you don’t run it with the -glnx86 argument, MATLAB will just say

        at the start of the installation. And it will use 32-bit.

        Then, just follow the instructions of the Installation Instructions section.

        After the installation, you will need to run MATLAB with the -glnx86 argument to force it to use 32-bit

        See the Troubleshooting section for more details on this.

        Installation Instructions

        Basic

        You will need superuser privileges. The assumption is that MATLAB install files are located at /media/MATHWORKS_R2012a in your filesystem.

      See the Troubleshooting section if you get into trouble during the installation.

      1. Run the MATLAB installer with the following Terminal command (The -v argument is for the install script to be verbose which means, it is more likely to warn you if something weird happens):

      If it complains about java, try installing install »OpenJDK Java 6» package because MATLAB is not compliant with Java 7.

      2. When prompted to ‘Choose installation type‘ you should select custom. This will allow you to create symbolic links to MATLAB in /usr/local/bin.

      3. When prompted to ‘Specify installation folder‘ it is recommended that you use the default folder /usr/local/MATLAB/R2012a (or the default /usr/local/MATLAB/R2012a_student if you have a student version).

      If you have a student version, the default folder will be /usr/local/MATLAB/R2012a_Student.

      4. When given the option to ‘Create symbolick links to MATLAB scripts in:‘ it is recommended that you check the box and use the supplied path /usr/local/bin.

      5. You can check that your installation work by executing the following command

      See the Troubleshooting section if you get errors.

      Create A MATLAB Launcher/shortcut

      Automatic option: install package «matlab-support», sudo apt-get install matlab-support or via the Software Center on the dashboard.

      Manual option as follows.

      2. Get the launcher file:

      If you have the student version of MATLAB (or simply the 32 bit version) on a 64 bit system, you will need to modify this file. Run

      Then uncomment #Exec=matlab -arch=glnx86 -desktop and comment Exec=matlab -desktop (by adding or removing the # character).

      If you get two MATLAB launcher icons in your Unity laucher, try uncommenting the following line in /usr/share/applications/matlab.desktop:

      If your launcher does not work, see the Troubleshooting section.

      MEX functions

      Warning

      The content of this section has been written for R2011a with Ubuntu 10.04 and 10.10. It may vary a lot if you are using the R2012a with Ubuntu 12.04.

      If you try to compile MEX functions you may see a message like the following:

      Note this is a warning — the MEX function will still compile.

      The following instructions will setup gcc 4.3 and make it the default compiler for MATLAB:

      2. Make a MATLAB specific bin directory for gcc symlink.

      3. Symlink gcc to gcc-4.3 via user MATLAB specific bin directory.

      4. Add MATLAB specific bin directory to the front of your system $PATH within your local startup.m file.

      Steps 3 and 4 above may not work for at least one instance of a user trying to compile using MEX in MATLAB R2011a running on Ubuntu 10.10. An alternative is to do the following:

      • 3a. At the MATLAB Command Window prompt, type:

      and choose option 2 which says:

      This will copy to your home directory a local copy of the file mexopts.sh.

      • 4a. Then edit this local file:

      and replace all instances of CC=’gcc’ to CC=’gcc-4.3′, CXX=’g++’ to CXX=’g++-4.3′, and FC=’gfortran’ to FC=’gfortran-4.3′. Save and exit. The next time you run MEX in MATLAB to compile it will work properly.

      For more ideas, try this thread or this one.

      Troubleshooting

      No MATLAB bin directory for glnxa64

      If MATLAB tells you

      when you launch it, you will need to force it to use glnx86.

      Solution for the command line (CLI) launch

      If you like launching MATLAB from the command line, you will maybe find it inconvenient to write -glnx86 each time you need to launch it. You can then add it in your

      /.bashrc (at the end if you hesitate where to put it)

      Solution for the graphical (GUI) launch

      You will need to add the -glnx86 argument to matlab in the exec line of your file /usr/share/applications/matlab.desktop If you have followed the ‘Create a MATLAB Launcher’ section, you can just comment the line with the argument -glnx86 and uncomment the next line as explained in the file.

      libc.so.6 not found

      If you have Ubuntu 12.04 you like get the following error when running Matlab graphically:

      Источник

      How to install MATLAB in Ubuntu 20.04

      MATLAB from Mathworks is a platform-independent software for solving mathematical problems and graphically displaying the results. The software package is best-known for tools for calculating and simulating complex mathematical and technical problems. Here we learn the steps to install MATLAB on Ubuntu Linux and how to create its Desktop shortcut…

      In addition to the basic module, a whole range of extensions for MATLAB is available, which is known as Toolbox. This includes Simulink, a graphical user interface block-oriented development platform for the modeling, simulation, and analysis of dynamic, non-linear, and event-driven systems, that can be used to model and simulate systems interactively.

      This programming platform is used for a wide range of tasks in industry and at universities, especially in control engineering and technical mechanics. It offers comprehensive functionality for mathematical calculations and visualization as well as a powerful programming language.

      The functionality of MATLAB can be used in two ways: one is by using an interactive calculation and simulation environment and the other by calling self-written MATLAB functions that use the numerical methods of MATLAB.

      When it comes to numerical procedures, this platform offers almost everything such as solving linear systems of equations, calculating zeros for any functions, numerical integration, and more.

      The thing is to be noted, MATLAB is a paid application and available to easily install for Windows 7 or 10, macOS, and Linux. And here we let you know the steps to be used for Linux such as Ubuntu.

      Steps to Install MATLAB for Ubuntu 20.04 Linux.

      The steps given here will not only applicable for Ubuntu 20.04 LTS but also work for Ubuntu 21.04 and 18.04 including Debian, Linux Mint, MX Linux, Zorin OS, Elementary OS, Deepin, CentOS, OpenSUSE, Kali, RHEL, and other Linux distros.

      1. Download MATLAB R2020b Linux version

      While writing this tutorial, the latest version of Matlab available to download was R2020b, however, that doesn’t mean the process of its installation will be changed, if you are one some other latest version.

      1. Open the browser and go to www.mathworks.com
      2. Click the download button for the current release
      3. Enter your email ID to Sign in, if you don’t have an account with MathWorks, then simply Sign up for it.
      4. Select between two options Get Trail or Link your licenses. Click on the Get Trail button, you can link your license, if you have, later otherwise continue using the trial version until it gets expired.
      5. Download the installer for Linux.

      2. Extract Zip file

      The MATLAB Linux installer will be in zip format, thus to get started with its installer, first we need to unzip the same.

      1. Open the Command terminal
      2. Switch to the Downloads directory because the files we download from the browser automatically go to that. Here is the command: cd Downloads
      3. Check the availability of files- ls
      4. Installer Unzip– sudo apt install unzip
      5. Create a folder to extract files- mkdir matlab
      6. Unzip the MATLAB file- unzip -qq matlab*.zip -d matlab

      3. Run MATLAB Linux Installer on Ubuntu 20.04

      Once the extraction of the zipped file has been completed, the next step is to run the installer that will offer a graphical user interface installation wizard.

      Switch to the directory we have created to extract MATLAB files:

      Now, display all files, inside it:

      Run installer

      4. Login with MathWorks Account

      Enter your Mathworks Account email address and password to use the corresponding available License information.

      5. Select the available License

      As we are using the Trail version, the license available corresponding to it will show there. If you have purchased one that will also appear in the “Select License” area. Alternatively, we can also enter the Activation key manually.

      6. Select Matlab Products or Toolbox to install

      All the Toolbox packages will appear, by default, all will be marked to install, if you want some particular Toolbox then choose that only and uncheck the others.

      7. Select Destination address

      Leave the default folder as it is unless you don’t want it to some other place and then select the NEXT button.

      To run the MATLAB directly from using the Command line terminal, we have to create a Symbolic for its script. For that check the box available for it.

      Note: In case you forget to check this option then we can create a symbolic link after the MATLAB installation using the following commands:

      If you have followed the above steps then it will be like this:

      9. Start the application

      Once the installation is completed, to start the MATLAB software, on your command terminal type:

      10. Create Matlab Desktop Shortcut Linux

      If you are on Ubuntu or using some other Linus Distro and want to create a MATLAB desktop shortcut icon to easily run it. Then follow the below steps:

      1. Open a command terminal

      2. Create a Desktop Shortcut file for MATLAB using the command:

      3. Copy-paste the below lines

      Note: Change Exec Path, in case you have installed Matlab in some other directory apart from the default one showing in the above-given lines.

      4. Save the Desktop Shortcut file by pressing Ctr+X and the type Y followed by the Enter Key.

      5. Now, go to the Desktop, right-click on the created file and select the “Allow Launching” option.

      6. Double click on the Ubuntu MATLAB desktop shortcut to start the application.

      11. Uninstall

      To remove the installation of Matlab, we just need to delete its folder and Syslink created by it. Here we are using the default path suggested by the software to install it, thus we are using that with the remove command. If you have used any custom directory then use the path of the same:

      Источник

      Читайте также:  Скопировать содержимое директории linux
    Оцените статью