Welcome! Log In Create A New Profile

Advanced

mlread on MATLAB R2022a

Posted by Aytthtna 
mlread on MATLAB R2022a
May 12, 2022 10:02PM
Hello,
I can't open bhv2 file using mlread function on MATLAB R2022a.
Does the function work on the MATLAB version?
Thank you.
Re: mlread on MATLAB R2022a
May 12, 2022 11:39PM
Please provide more information. Your not being able to open it does not mean that the function does not work. Do you see an error message?
Re: mlread on MATLAB R2022a
May 16, 2022 10:45PM
Yes, I ran the "BHV2 = mlread( bhv2 filename )" and the following error message appeared.

------------------------------
Error using fread
Invalid precision.

Error in mlbhv2/read_variable (line 253)
val = reshape(fread(obj.fid,prod(sz),['*' type]),sz); % fread can handle only a 2-d size arg.

Error in mlbhv2/read_variable (line 246)
for n=1:nfield, [a,b] = read_variable(obj); val(m).(b) = a; end %#ok<AGROW>

Error in mlbhv2/read_variable (line 246)
for n=1:nfield, [a,b] = read_variable(obj); val(m).(b) = a; end %#ok<AGROW>

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

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

-----------------------

When I use the same command on MATLAB R2020b, it works.
Re: mlread on MATLAB R2022a
May 16, 2022 11:02PM
Please send me the data file so that I can test.

-----

Have you read this, by the way?
https://monkeylogic.nimh.nih.gov/board/read.php?2,1166,1166#msg-1166
Re: mlread on MATLAB R2022a
May 22, 2022 10:25PM
Sorry, Jaewon.
The function worked on MATLAB R2022a.
The path setting might cause the error.
Re: mlread on MATLAB R2022a
May 23, 2022 12:08AM
Thanks for getting back to me with this.

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.