How to open multiple matlab files in one instance of the matlab by double clicking in Ubuntu
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to be able to open matlab files in Ubuntu simply by doubly clicking on them (same like it is working on MacOs or Windows).
To do that I've added matlab to the list of applications and associated it to the *.m and *.fig files in my file manager. So now I can open *.fig and *.m files by double-clicking on them. The problem is that every new file is starting new instance of matlab instead of opening it in the already launched one.
Is it possible to fix it?
the matlab.desktop file that I'm using is:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=matlab -desktop -r "open %f"
Name=MATLAB
Icon=/usr/share/icons/hicolor/48x48/apps/matlab.png
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
StartupWMClass=com-mathworks-util-PostVMInit
matlab version is R2019a
Ubuntu version is 18.04.3
1 commentaire
Moritz Feuerle
le 29 Fév 2020
I have the same problem. It is realy annoying, would be great if there is a solution for that
Réponses (2)
Sai Sri Pathuri
le 3 Mar 2020
Unfortunately, this is expected behavior on Linux. Only Windows and Mac have special implementations of double-click behavior. The desired double-click behavior is unavailable on Linux.
These are some alternatives you can try instead:
1. Dragging the .m file onto the MATLAB Command Window which caused MATLAB to run the file
2. By dragging it on top of the Editor window (if it was already visible) which caused MATLAB to edit the .m file
1 commentaire
Ali Aghaeifar
le 3 Nov 2022
But in other applications, e.g., gedit, double-click behavior is as expected, i.e., all files open in one instance of gedit.
David Capan
le 10 Sep 2022
Exec=matlab -desktop -r "open %F"
This should work.
%f for one file, %F for multiple files.
0 commentaires
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!