How to create a link to execute Matlab from terminal

Forum rules
Before you post please read this

How to create a link to execute Matlab from terminal

Postby Axolotl on Sat Oct 06, 2012 8:50 pm

Hi

I have installet Matlab on /My_user/Programs/Matlab and the executable matlab file is /My_user/Programs/Matlab/bin/matlab . I want to create a "command" to execute Matlab from the terminal but I don't know how. I already tried to use "ln -s /complete-route/ matlab " but when I write "matlab" nothing happens. I know maybe this is a very newbie question but I'm stuck

I'm also want to create a launcher for matlab in my desktop but when I try to open it says "Broken Link" but I'm sure I wrote the correct adress

Thanks
Axolotl
Level 1
Level 1
 
Posts: 2
Joined: Sat Sep 22, 2012 11:19 pm

Linux Mint is funded by ads and donations.
 

Re: How to create a link to execute Matlab from terminal

Postby xenopeek on Sun Oct 07, 2012 2:46 am

Moving this here as this isn't a tutorial but a support request.

If you want to run a file in your current directory, you have to precede it with "./" to make clear the file should not be search for in the path but in the current directory. So if you have created a symbolic link to matlab, run it from the directory where you have that symbolic link with:
Code: Select all
./matlab
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14802
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How to create a link to execute Matlab from terminal

Postby itsme4401 on Sun Oct 07, 2012 4:37 am

Remember: almost all varieties of Linux are case-sensitive!
You're speaking about Matlab and matlab, so check that first.
I have installet Matlab
&
ln -s /complete-route/ matlab
itsme4401
Level 3
Level 3
 
Posts: 104
Joined: Sat Nov 27, 2010 4:12 pm
Location: Netherlands

Re: How to create a link to execute Matlab from terminal

Postby baptiste on Wed Oct 31, 2012 9:14 pm

Sorry, this topic is a bit old but I believe the proper way to run such things from the command line, or at least an easy one, is with aliases.
An alias is a simple command substitution done by the bash command prompt, you only have to type alias matlab='/my/path/bin/matlab'

I use just a few aliases for little stuff I would otherwise type all over again but don't need to be in a script at all.
These go in ~/.bashrc (source .bashrc reloads it)
also I have a shorthand alias cd..='cd ..', because it's one space less to type and worked in DOS/Windows :oops:
baptiste
Level 2
Level 2
 
Posts: 98
Joined: Sun Jan 22, 2012 12:25 am


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest