M-files opening in new instances of MATLAB during each click: Mac computer

22 vues (au cours des 30 derniers jours)
Jessica
Jessica le 10 Mar 2018
Réponse apportée : Moin le 30 Juin 2022
Is there a fix for file associations in a mac (m-files don't open up in MATLAB but open up in a new instance of MATLAB instead)?

Réponses (1)

Moin
Moin le 30 Juin 2022
I understand, that when you are trying to open a m-file, a new instance of MATLAB is being created instead of opening in the same MATLAB instance.
There might be 2 reasons for this.
1. Your current MATLAB instance is created as root privileged (administrator). So when you try to open the m-file normally, as it doesn’t have the administrative privileges, a new instance has been created.
To work around this issue, you can enable writing to the pathdef.m file. The pathdef.m file is located in the directory:
MATLABROOT\toolbox\local
where MATLABROOT is the result of executing the following in the MATLAB zsh:
matlabroot
To enable writing to pathdef.m:
  1. Open the directory with pathdef.m in Finder, right-click on the file and click “Get Info” button.
  2. Click the “Sharing and permissions” button to modify permissions.
  3. Select the user or group that should be allowed to write to pathdef.m, i.e., Users.
  4. Check the "Write" check box and click "Apply"
If you have previously set MATLAB to be run as an administrator, change it to run it as an ordinary user. You will be now able to save path to the pathdef.m file and each time you click on the MATLAB file, if MATLAB is already open, MATLAB file will be opened in the Editor of the open MATLAB instance.
2. This issue may also arise if you uninstall an earlier release of MATLAB after installing a newer release. The newer release uses a different method to register file associations.
These associations are deleted from the registry when an older release is uninstalled. In this situation, please uninstall the new release and reinstall it.

Catégories

En savoir plus sur Desktop 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!

Translated by