matlab editor switching to onedrive

15 views (last 30 days)
Hi There
I have set the startup path to be a folder on my C drive, but as soon as I press the run button on my editor, it switches to the copy on onedrive, and changes my director, which seems to be a very big problem because the script access huge files on my cdrive, and now everything is really slow. How do I go back to it just running the version on my C drive?
Thank you
Karin
  1 Comment
Rik
Rik on 23 Nov 2022
Where is the file in your editor window located? The C drive or online?

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 23 Nov 2022
Not sure what you mean. The one on your C drive is in your OneDrive. You have a local copy and a cloud copy. But the local copy on your C drive is normally under the C:\users folder. For example all my MATLAB code is on my OneDrive. I also told it to always keep a local copy so if it tried to get a file that's no longer living on the local hard drive, it won't have to take time to download it from the cloud OneDrive. So my local folder on my SSD drive looks like this:
C:\Users\myName\OneDrive - MyCompanyName\Not Shared\Matlab\work\Demos
If I click in the address line above the editor window, that is what shows up. So, yeah it says OneDrive but it's still local despite the folder name. Just because you see OneDrive in the folder does not mean the actual file you're dealing with is in the cloud. It's local. It makes sure it is. The only difference is that if you don't tell it to always keep a local copy, when you try to do something with that file, if it's not local (like you haven't used it recently) it will have to download a local copy from the cloud version of your OneDrive. Then after a while of not being used, OneDrive will delete the local copy to save disk space, until you need it again and then it will bring it back down again. However if you right clicked on the folder and told it to "Always keep on this device" then it will never delete your local copy to free up space. I mainly do this because I'm more interested in not waiting for files to download (if they're not currently local) than I am in having available disk space.
The one thing to keep in mind is that the cloud copy of the file is the MASTER version. So if you think that you just don't want to backup some files and delete them from the cloud, don't think they're gone from the cloud ONLY. It will also delete them from your local drive as well (I got burned by this once before I understood how it works). One Drive is not like a backup. It's a sync. So deleting it either locally or in the cloud (via your browser) will delete it in BOTH places! It will, though, put the deleted files into the cloud version of your recycle bin.
  2 Comments
Image Analyst
Image Analyst on 24 Nov 2022
OK glad I could explain it. I know it can be tricky. Could you please then click the "Accept this answer" link? Thanks in advance. 🙂

Sign in to comment.

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!