MATLAB: What is different between fget1 and fread

enviread error with fget1

path='F:\多光谱材料\2\2.hdr';
>> fnm='2.hdr';
>> I=enviread(path,fnm);
??? Error using ==> fgetl at 44
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in ==> enviread>read_envihdr at 190
line = fgetl(fid);
Error in ==> enviread at 16
info=read_envihdr(hdrfile);

Best Answer

I don't think enviread is a function provided by mathworks. It appears it is something that users have provided.
Try multibandread() function of matlab to read ENVI files. I use this function when I am reading ENVI files and it works very well. If you want some instruction on how to use it to read ENVI files, the following is a good resource.