Welcome! Log In Create A New Profile

Advanced

Error reading bhv2 file using mlread

Posted by IVanegas 
Error reading bhv2 file using mlread
August 03, 2023 01:41AM
Hi Jaewon.
I am using mlread to load a bhv2 file, and I am getting the following error:

Error using mlbhv2/read_variable (line 372)
An error occurred while reading the variable, 'Trial42'.

An error occurred while reading the variable, ''.

Invalid precision.

Error in mlbhv2/read_trial (line 130)
[a,b] = read_variable(obj);

Error in mlread (line 25)
data = fid.read_trial();


Please let me know if there is another way I can extract the trial / behavioral information, or what could have caused this issue? It is the first time I see such error.

Thank you very much.
Re: Error reading bhv2 file using mlread
August 03, 2023 07:09AM
I cannot tell without looking into the file. Please send it to me.
Re: Error reading bhv2 file using mlread
August 03, 2023 02:25PM
Your file is corrupted. The end of Trial42 and the beginning of Trial43 are erased and filled with 0. It is likely due to a disk error.

Overwrite your mlbhv2.m with the attached file. Then you will be able to read the rest of the file, skipping Trial 42 & 43.

-----

The attached file is now included in the download packages.
Re: Error reading bhv2 file using mlread
August 03, 2023 03:40PM
Great, I replaced my mlbhv2.m and I was able to extract the behavioral information I needed.

Thank you very much for your help.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.