How to open multiple matlab files in one instance of the matlab by double clicking in Ubuntu
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Moritz Feuerle
el 29 de Feb. de 2020
I have the same problem. It is realy annoying, would be great if there is a solution for that
Respuestas (2)
Sai Sri Pathuri
el 3 de Mzo. de 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 comentario
Ali Aghaeifar
el 3 de Nov. de 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
el 10 de Sept. de 2022
Exec=matlab -desktop -r "open %F"
This should work.
%f for one file, %F for multiple files.
0 comentarios
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!