Problem with file loading in for loop

Hi there,
I am trying to analyze a bunch of mat files by loading them in a for loop. I am also saving the output in a structure. The code runs smoothly for a while but after some iterations exits with the following error:
HDF5-DIAG: Error detected in HDF5 (1.8.6) thread 0:
#000: H5Dio.c line 174 in H5Dread(): can't read data
major: Dataset
minor: Read failed
#001: H5Dio.c line 448 in H5D_read(): can't read data
major: Dataset
minor: Read failed
#002: H5Dchunk.c line 1720 in H5D_chunk_read(): unable to read raw data chunk
major: Low-level I/O
minor: Read failed
#003: H5Dchunk.c line 2748 in H5D_chunk_lock(): data pipeline read failed
major: Data filters
minor: Filter operation failed
#004: H5Z.c line 1115 in H5Z_pipeline(): filter returned failure during read
major: Data filters
minor: Read failed
#005: H5Zdeflate.c line 125 in H5Z_filter_deflate(): inflate() failed
major: Data filters
minor: Unable to initialize object
Error using load
Can't read file
/home/tushar/tushar/OXYGEN/part62_oxy_240.mat.
Error in PART_STATS(line 17)
Data = load(files(ii).name); %......Data will store the latest file name
variable (AS a struct)
When I ran the code on some other files, it ran without a problem. Could someone help me with this error.
Thanks,
Tushar

3 个评论

Could you try loading that file by itself and see if it works that way? We need to isolate whether the problem is the file, or is in the fact that a bunch of files were read in series.
The mat-file, which causes this error, is most likely corrupt. Have you tried
>> load part62_oxy_240.mat
in the command window?
Thanks guys,
It is that file that is the issue. It was corrupt. Hopefully I do not get such scary messages again. Thanks again for your time and help.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by