Matlab can't load .mat or .fits files from OneDrive

51 views (last 30 days)
I have few data sets, say,
  1. fileA.mat (< 1 GB),
  2. fileB.mat (2 GB) and
  3. fileC.fits (3 GB).
I can load and read all the files inside MATLAB (R2020b-academic license) without any issues. However if the files are inside the microsoft OneDrive folder that are synced to the cloud, MATLAB is giving an error when I tried to load except the fileA.mat. 'Files on Demand' in onedrive is disabled and 'Always keep the file in this device' is enabled. Also, the copied file in the onedrive is not corrupted. Below are the error messages I get when loading,
Error when using FITS (fileC.fits):
>import matlab.io.*
>fptr = fits.openDiskFile(fitsfname, 'READONLY');
Error using fitsiolib
Unable to perform requested action. Filename contains unsupported characters.
Error in matlab.io.fits.openDiskFile (line 69)
fptr = fitsiolib('open_diskfile',filename,mode);
Error when using .mat (fileB.mat):
>filename = 'withI150mA.mat';
>load(filename);
Error using load
Unable to read MAT-file D:\OneDrive - Uniwersytet xxxxxxx\withI150mA.mat. Not a binary MAT-file. Try load -ASCII
to read as text.
Thanks in advance for the solutions.
  9 Comments
Sulaymon Eshkabilov
Sulaymon Eshkabilov on 15 Jan 2023
Have you tried to change the directory to the path where you mat files are residing, e.g.:
cd(D:\OneDrive - Uniwersytet xxxxxxx\)
Eva
Eva on 1 Feb 2023
same issue..MATLAB can't open files with OneDrive in the pathway...but I can't get rid of the OneDrive. Does anyone know how?

Sign in to comment.

Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!