
Why do I receive an error while trying to "cd" to folders on Mac?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 5 Mar 2025
Modifié(e) : MathWorks Support Team
le 5 Avr 2025
Walter Roberson
a ajouté un drapeau à question
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?
Réponse acceptée
MathWorks Support Team
le 4 Avr 2025
Modifié(e) : MathWorks Support Team
le 5 Avr 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown 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!