aimonas
November 3rd, 2009, 06:20 PM
hello everyone! I would like to share and at the same time book-keep a few things that have made my life easier while using matlab under ubuntu.
1. open m-file with matlab through nautilus
The concept is to assign a default custom command to open m-files. This is done through right-click-->properties>open with tab-->add-->use a custom command, at which point we input
matlab -desktop -r "edit %f"
This action however, opens matlab and the editor with the desired file loaded, but leaves the working directory to its default value. I haven't found a way to change the directory simultaneously, so if anyone could give any clue it would be nice.
2. click on m-file and open matlab at the respective directory
Same procedure as previously, but we input the following command
matlab -desktop -r "cd %d"
3. navigate to any folder in the filesystem and open matlab to work in that specific folder
a. prepare a small script (let's name it matcd) as follows:
#!/bin/sh
matlab -desktop -r "cd %d"
b.render it executable through right-click-->properties-->permissions
c. copy it to ~/.gnome2/nautilus-scripts/ and restart system or log out and log back in
then by right clicking inside any folder you can find the script in the submenu scripts. running it will perform the desired action
hope this is useful
cheers
1. open m-file with matlab through nautilus
The concept is to assign a default custom command to open m-files. This is done through right-click-->properties>open with tab-->add-->use a custom command, at which point we input
matlab -desktop -r "edit %f"
This action however, opens matlab and the editor with the desired file loaded, but leaves the working directory to its default value. I haven't found a way to change the directory simultaneously, so if anyone could give any clue it would be nice.
2. click on m-file and open matlab at the respective directory
Same procedure as previously, but we input the following command
matlab -desktop -r "cd %d"
3. navigate to any folder in the filesystem and open matlab to work in that specific folder
a. prepare a small script (let's name it matcd) as follows:
#!/bin/sh
matlab -desktop -r "cd %d"
b.render it executable through right-click-->properties-->permissions
c. copy it to ~/.gnome2/nautilus-scripts/ and restart system or log out and log back in
then by right clicking inside any folder you can find the script in the submenu scripts. running it will perform the desired action
hope this is useful
cheers