Matlab error: Error using ==> fread; Invalid file identifier

Status
Not open for further replies.

rami823

Newbie level 3
Joined
Mar 24, 2008
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
fid = fopen('alphabet.txt', 'r');
>> c = fread(fid, 5, 'uint8=>char')'
??? Error using ==> fread
Invalid file identifier. Use fopen to generate a valid file identifier.


hello all I am getting an error when running the code above, any clue?
 

invalid file identifier -1 for matlab

What is the fid value? Is it positivr or not? If it is positive you don't read the file truly.
 

Re: Weird MAtlab Error

You probably tried to read a file not existing in working directory?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…