I'm trying to open a file in this function, for the purpose of using it in another function. However, when I call on it, it gives me the error in fread, as stated in the title. I believe this is a result of fopen failing to open the file. However, I'm not certain how to fix it. Any help is appreciated. Thank you.
fileID = fopen(filename, 'rt');
[A,count]= fread(fileID,[2 inf], 'uint8');