I had the same issue. I just now fixed it. In ubuntu 18.04. which I had previously I just installed the matlab application from the Ubuntu Software app. But in ubuntu 20.04 you need to use the Software app
And there install the package:
This will create the matlab.desktop file and from there you can just follow the instructions you linked (adding -r "edit %f" after the launch command). Hope this helps.
Can you explain where to add r "edit %f" and how that tells ubuntu to open *.m with MATLAB.
I have a related problem. Maybe I should ask in a new thread, but:
MATLAB is trying to run an update. My MATLAB is installed for my user only in ~/.local . When I attempt to update, I get a permissions error. My user account doesn't have write permission to ~/.local/share/MATLAB/R2020a. I tried launching MATLAB with sudo matlab but this fails because my MATLAB license is tied to my username; it won't launch for user root. How can I update??
1) if you look at the package description that I included it tells you, the package does not include an installation of matlab. Instead it creates matlab.desktop for you (autmatically and correctly - but I'm not sure how it handels non-default installation directories) as well as it does some other magic to make sure MATLAB shows up in the open with context menu. Then you can just click on propperties and set MATLAB as default for any .m file.
2) If you are here and you can launch MATLAB just by double clicking a .m file. You will see that your MATLAB opens in your home directory and no script tab is open, only the commant line. So at this state you are forced to manually find the file you previously clicked inside matlab's "open file". This is where the <-r "edit %f"> comes in. It enables ubuntu passing arguments with MATLAB when launching it. Arguments, such as, the file you double clicked.
Lastly, the way I got it working was: Install MATLAB from .deb file using the Software app (not the Ubuntu Software app), used deafult installation path. Installed the MATLAB (community patch) package from the Software app, opened matlab.desktop and appended the <-r "edit %f"> at the end of "Exec=/..." line. Then restarted my machine.
The quotes are really important. Without them, MATLAB just opens an empty editor because the filename is parsed as a separate argument to MATLAB, rather than part of the command for MATLAB to run.
Changing the .desktop file in this way makes MATLAB open with an empty editor window if you're just launching MATLAB directly from its icon. There must be a way to make the -r "edit %f" part conditional. I'm creating a separate question about that.
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Translated by
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.