- Open the directory with pathdef.m in Finder, right-click on the file and click “Get Info” button.
- Click the “Sharing and permissions” button to modify permissions.
- Select the user or group that should be allowed to write to pathdef.m, i.e., Users.
- Check the "Write" check box and click "Apply"
M-files opening in new instances of MATLAB during each click: Mac computer
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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)?
0 comentarios
Respuestas (1)
Moin
el 30 de Jun. de 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:
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.
You can find some more solutions in here: https://in.mathworks.com/matlabcentral/answers/93468-why-is-a-new-instance-of-matlab-opened-when-i-double-click-on-a-matlab-file-in-windows-explorer-even
0 comentarios
Ver también
Categorías
Más información sobre Desktop 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!