Problems with savepath in R2023b

I have just installed R2023b on two different machines. Both give the following problem, when trying to use savepath
>> addpath(pwd)
>> savepath
Warning: Unable to save path to file 'C:\Program Files\MATLAB\R2023b\toolbox\local\pathdef.m'. You can save your path to a different location
by calling SAVEPATH with an input argument that specifies the full path. For MATLAB to use that path in future sessions, save the path to
'pathdef.m' in your MATLAB startup folder.
> In savepath (line 238)
Any idea why this warning is issued and how to fix it?

3 comentarios

Nick
Nick el 25 de Sept. de 2023
The problem is new with R2023b, on the previous versions there were no warnings like that.
Peter Nelson
Peter Nelson el 25 de Sept. de 2023
I am seeing the same issue
Scott Milster
Scott Milster el 28 de Feb. de 2024
I have a similar problem in that my path is messed up. I just had 2023b installed Monday and I found out yesterday that the command line can't find readlines.m, but when I type 'help readlines' the help portion shows up.

Iniciar sesión para comentar.

 Respuesta aceptada

Matt J
Matt J el 25 de Sept. de 2023
Editada: Matt J el 25 de Sept. de 2023

1 voto

Tech Support advised running Matlab "As Administrator" and this did solve the problem.

5 comentarios

Bruno Luong
Bruno Luong el 25 de Sept. de 2023
Editada: Bruno Luong el 25 de Sept. de 2023
This is odd work around, it seems to me MATLAB should be run without administrator right, for whatever reason I can't remember right now (possibly the very reason that you ask here).
EDIT: I just check the doc and it is indeed say
"On a Windows® system with User Account Control (UAC) enabled, you might be prompted to allow the update operation because it requires administrator-level permission."
Xiaorui Tang
Xiaorui Tang el 28 de Sept. de 2023
Editada: Xiaorui Tang el 28 de Sept. de 2023
Thank you for bringing this issue to our attention.
We have confirmed that this is a bug in the savepath function on Windows in MATLAB R2023b, and we sincerely apologize for any inconvenience this may have caused.
We're working on a solution for this issue, which will be included in one of the upcoming MATLAB 2023b Update releases soon.
In the meantime, there are two workarounds to save the path:
1. Manually change the permissions of the pathdef.m file in Windows:
  • Use the "which pathdef" command in MATLAB to identify the location of the pathdef.m file. It should be located at <matlabroot>\toolbox\local\pathdef.m
  • Navigate to this location in your Windows File Explorer.
  • Right-click on the pathdef.m file and select 'Properties'.
  • Navigate to the 'Security' tab.
  • Click on 'Edit' to change permissions, and ensure 'Full control' is checked under the 'Allow' column for your user account.
OR
2. Run MATLAB with administrative rights:
  • Close MATLAB if it is currently open.
  • Right-click on your MATLAB shortcut on the desktop or in the start menu.
  • Select 'Run as administrator'.
These are temporary workarounds and should be unnecessary once the bug is fixed in the upcoming MATLAB 2023b Update releases.
We appreciate your understanding as we work to resolve this issue.
Thanks,
MathWorks Dev Team
Xiaorui Tang
Xiaorui Tang el 21 de Dic. de 2023
An update for this: The bug has been fixed in R2023b Update 4. Please get it to resolve the issue. Thanks!
Steven Lord
Steven Lord el 21 de Dic. de 2023
FYI, I believe this is Bug Report 3092284.
Michael Vinskus
Michael Vinskus el 5 de Feb. de 2024
Editada: Michael Vinskus el 6 de Feb. de 2024
Same issue occurred w/ me running 2023b, Update 6 after a clean install today (05-FEB-2023). Issue may have been the presence of startup.m in the user MATLAB directory.

Iniciar sesión para comentar.

Más respuestas (2)

Bruno Luong
Bruno Luong el 25 de Sept. de 2023
Editada: Bruno Luong el 25 de Sept. de 2023

2 votos

On Windows to fix it you need to change the Security setup of the file pathdef.m Right Click on file, Properties, Tab Security, Select Users, then click on Edit, Check Full Control, Then Apply.
Before
After

1 comentario

Tom
Tom el 9 de Feb. de 2024
That was the easiest fix in my opinion - running as administrator works too.

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 25 de Sept. de 2023
Movida: Walter Roberson el 25 de Sept. de 2023

1 voto

On a shared system, users should not have write access to pathdef.m inside the MATLAB installation directory.
If this is not a share system, you could try using File Explorer to set you as having write permission to the file. But it being Windows, I do not know if UAC would override that write access since it is a file living inside c:\Program Files . Easiest is to savepath to your userpath . Or change your preferences to point to a different folder; see https://www.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html

1 comentario

Rolfe Power
Rolfe Power el 25 de Sept. de 2023
I don't think this is the issue here. There are valid reasons for setting the pathdef for all users and this worked in previous versions given the user attempting to set the path had admin privileges. Now, it prompts for these privileges then throws the warning seen above even when the change is approved.

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Productos

Versión

R2023b

Etiquetas

Preguntada:

el 25 de Sept. de 2023

Comentada:

el 28 de Feb. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by