Search This Blog

Saturday, August 25, 2012

Create Terminal Command for Matlab in ubuntu

go to terminal and you can run ( I have installed matlab 2009a )

/opt/matlab2009a/bin/matlab


 If you want to type only $matlab in your terminal the do the following from terminal to set the path:

export PATH=$PATH:/opt/matlabr2007a/bin
source ~/.bashrc 

 Then type

matlab

in terminal from wherever you want, you will get your matlab window in your screen .


Thank you..



Install matlab in Ubuntu from an ISO image file

Do the following as root

1) Mount the ISO
  mount -o loop Mathworks.Matlab.R2007a.UNIX.DVD.ISO /mnt/temp 


2) Create the directory you want to install MATLAB into
  mkdir /opt/matlab 


3) Copy the license file into it from directory. I used the node-locked
version

  cp /mnt/temp/license_locked.dat /opt/matlab/license.dat

4) Install the program
  cd /opt/matlab; /mnt/temp/install


5) Read inst_doc.pdf on DVD (/mnt/temp/inst_doc.pdf) and setup startup scripts
to automatically start the license manager.




Optional:::::::::

6) I was having some crashes when running commands like "help" or changing
fonts. 
The crash was in libfontmanager.so which is part of JAVA. 
So I
installed latest version of JAVA (sun-jre-bin-1.6.0) and 
set environment
variable MATLAB_JAVA=/opt/sun-jre-bin-1.6.0/ [ Change this location 
to
wherever you have installed your JRE ]. 
To make this permanent, add this line
to your ~/.bashrc or /etc/profile
export MATLAB_JAVA=/opt/sun-jre-bin-1.6.0


7) Setup web-browser for MATLAB. 
Edit /opt/matlab/toolbox/local/docopt.m
   Change line 52 from
   %   doccmd = '';
   to
   doccmd = 'firefox';

MATLAB on Ubuntu: From Install, Make launching Icon,… to Uninstall

MATLAB on Ubuntu: From Install, Make launching Icon,… to Uninstall

 

Here are the steps to install MATLAB + some possible problems:
  1. Extract/mount the zipped/iso installer file. For me I extract the iso to /home/bot/Downloads/Software/ml2011bu
  2. Open the terminal (Ctrl+Alt+T), type sudo sh install
    1. You might run into the problem say:Preparing installation files …
      Installing …
      eval: 1: /tmp/mathworks_2931/sys/java/jre/glnx86/jre/bin/java: Permission denied
      Finished
      bot@bot-laptop:~/Downloads/Software/ml2011bu$ cd sys What you need to do is to make the file “java” executable by
      from your installer folder, type
      cd sys/java/jre/glnx86/jre/bin/
      chmod +x java
      you will see that the file permission is changed from
      -rw-r–r– 1 bot bot  47308 2010-10-20 04:41 java
      to
      drwx–x–x 4 bot bot    4096 2012-02-11 17:55 java
      Now go back to the installer folder and install it with sudo sh install, and it should work
    For more details on installation, please visit
    https://help.ubuntu.com/community/MATLAB
Once the installation is finished, you may want to create a script to run the MATLAB. Here is how
  1. Go to desktop (where else is fine too)
  2. Create an empty document, let’s name it runmatlab.sh
  3. Open runmatlab.sh with gedit, and type the following
    cd /usr/share/matlabr2010a/bin/
    sudo sh matlab -desktop
  4. Open the terminal, go to desktop by typing in the terminal cd ~/Desktop
  5. make the script executable by typing in the terminal chmod +x runmatlab.sh
  6. Now you can run MATLAB by running the script by typing ./runmatlab.sh
Now, if you want to add a launching icon on the menu bar, here is how:
  1. Right click on the menu bar
  2. Edit menus>Go to Programming in the left panel
  3. Click new item and add all the information
  4. In the command, type /home/bot/Desktop/runmatlab.sh
  5. You can also change the icon by clicking at the icon on the top-left corner and choose where the icon is
    1. Here is an easy command line to download the icon
      sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png
    2. The icon will be downloaded to /usr/share/icons/matlab.png
  6. That’s it!
And, if you are bored with MATLAB and want to uninstall it, please follow the steps here
  1. Locate the matlab dir, mine is /usr/local/MATLAB
  2. Remove the matlab dir by
    >cd /usr/local
    >sudo rm -r MATLAB
  3. bye bye MATLAB, and you get 5GB more space hahahaha!