
Why do I receive an error while trying to "cd" to folders on Mac?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 5 de Mzo. de 2025
Editada: MathWorks Support Team
el 5 de Abr. de 2025
Walter Roberson
ha marcado con alerta este/a pregunta
On my Mac, I am trying to "cd" to the to the Desktop folder in MATLAB using the command below:
>> cd /Users/myusername/Desktop
However, I am encountering the following error:
Error using cd
Unable to change current folder to '/Users/myusername/Desktop'
The error does not occur when trying to navigate to other folders, such as /Users/myusername/Documents.
What is happening here? How can I fix this issue?
Respuesta aceptada
MathWorks Support Team
el 4 de Abr. de 2025
Editada: MathWorks Support Team
el 5 de Abr. de 2025
The underlying issue is related to the application permissions within your operating system. Specifically, on macOS, applications are granted access to specific folders, and it seems that MATLAB currently lacks permission to access the Desktop folder.
To address this problem, you need to grant MATLAB the necessary access permissions. You can do so by following the instructions in Control access to files and folders on Mac and/or Controlling app access to files in macOS.
We also recommend giving MATLAB "Full Disk Access" by going through Apple menu > System Settings > Privacy & Security > Full Disk Access, as indicated in the picture below:

0 comentarios
Más respuestas (0)
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!