MATLAB unable to find files
55 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am working on a project and MATLAB fails to open files for me. I downloaded some .m files off of my OneDrive and they were perfectly fine and uncorrupted. Furthermore, I was able to view them in OneDrive without issue. When I downloaded the file and put it into the folder where I was working in, the file didn't open when I tried to double click it.
MATLAB told me it was unable to find the file despite the fact that it was in the folder I was working in and returned the correct path. When attempting to troubleshoot, I noticed that one recommendation was to have MATLAB use the default folder in Documents/MATLAB. Since that folder was in my OneDrive for some reason, I made a new one saved on my computer and tried to have MATLAB open to that upon start-up. MATLAB then told me the folder didn't exist when I tried to submit the new path.
Ultimately, I decided to copy the contents of the .m file and paste it into a new .m file created through MATLAB, which worked just fine. However, I cannot find the reason for the issue in the first place. I'd like some help figuring out what can be done.
5 comentarios
Image Analyst
el 27 de Oct. de 2025
When you go to File Explorer and look at the One Drive source folder, does it have a white check mark in a green circle next to the file names.

This means you're telling OneDrive to always keep a local copy. If it's not checked then the only copy (if you haven't accessed the file in a while) will be on the OneDrive server in the cloud. And perhaps there's some kind of delay in downloading the file from the cloud from the time you try to paste it until it actually gets there. Click on the cloud in the lower left task tray of your task bar and see if it says "Your files are synced."
To make sure you always have files on your local hard or SS drive, right click on the folder that you want to always keep local and select "Always keep on this device". I think that should apply to all the files within the folder too. You should see green checkmark circles when it's done.
Respuesta aceptada
Victor
el 28 de Oct. de 2025
Movida: Walter Roberson
el 29 de Oct. de 2025
1 comentario
dpb
el 28 de Oct. de 2025
Movida: dpb
el 29 de Oct. de 2025
Read about <What is MATLAB search path?> and how to set an additional folder on startup. Or, you can use the Settings dialog to define and save the revised MATLABPATH. You definitely don't have to do this manually every time.
My general practice is to have a specific working directory for current work and add it to the top of the search path and have that saved
Más respuestas (0)
Ver también
Categorías
Más información sobre File Operations 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!