Why do I receive an error while trying to "cd" to folders on Mac?

5 ビュー (過去 30 日間)
この 質問 は Walter Roberson さんによってフラグが設定されました
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?

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 4 月 4 日
編集済み: MathWorks Support Team 2025 年 4 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by