Why is Matlab unable to change current folder?

238 views (last 30 days)
I have just downloaded R2021b version of Matlab, but I have problems with the folders. When I run it, the initial folder is that of my User, from where I try to open the Desktop, where all my old files are saved. A message appears stating
"Error using cd
Unable to change current folder to '/Users/Cuchaira/Desktop'."
How can I solve the problem?
  1 Comment
Rik
Rik on 15 Nov 2021
How exactly are you trying to change the current folder? The error looks like you are using windows, and forgot C: and are using the wrong slashes.

Sign in to comment.

Accepted Answer

Chiara Pasquariello
Chiara Pasquariello on 4 Dec 2021
Problem solved, it was just that I had not allowed Matlab to access to all the files on the Mac. Thanks everyone for you answers!
  2 Comments
Sabine Kling
Sabine Kling on 19 Jan 2022
I am having the same issue. How did you permit Matlab to access all files on the Mac?
Joshua Carmichael
Joshua Carmichael on 22 Oct 2022
Hi Sabine:
  1. Go to system preferences.
  2. Select Security and Privacy
  3. On the top menu ribbon within Security and Privacy, select Privacy
  4. Unlock with admin account and password so you can make changes/ select applications.
  5. Select Matlab. Allow full disk access from left menu.
  6. Allow matlab to restart.
  7. Relock the lock button on the lower left.
  8. Now Matlab should have full disk access. See below.

Sign in to comment.

More Answers (1)

Anshika Chourasia
Anshika Chourasia on 3 Dec 2021
Hi Chiara,
For changing the current folder “cd” command is used. Please refer the following link for more details: Change current folder - MATLAB cd (mathworks.com).
  1 Comment
Dyuman Joshi
Dyuman Joshi on 5 Mar 2024 at 5:14
That is what OP is already using.
I don't see how your answer adds helps OP.

Sign in to comment.

Categories

Find more on Downloads in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!