error using fread

4 views (last 30 days)
suzwani ismail
suzwani ismail on 12 May 2012
hye..i have a problem when run coding in matlab. it will give output like this
??? Error using ==> fread Invalid file identifier. Use fopen to generate a valid file identifier.
the fid value is -1.
i'm doing a final year project about image steganography. the problem is, when i use an image named 'baboon' with dimension 512x512, it run successfully. but when i use image named 'baboon1' with the same dimension and image, it will give error.
could anyone please tell me why?
  1 Comment
Jan
Jan on 12 May 2012
It is recommended to post the code, which causes the error. The size of the image is not helpful.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 12 May 2012
What do you mean by " use"? Did you read in (or try to read in) either one of both images using imread()? Or did you try to use fread() for some reason?

Walter Roberson
Walter Roberson on 12 May 2012
You are not testing the result of fopen() in order to determine whether the open succeeded or not. fid of -1 means that the open failed. The second output from fopen() will tell you the reason why.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!