error using fread

7 visualizaciones (últimos 30 días)
suzwani ismail
suzwani ismail el 12 de Mayo de 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 comentario
Jan
Jan el 12 de Mayo de 2012
It is recommended to post the code, which causes the error. The size of the image is not helpful.

Iniciar sesión para comentar.

Respuestas (2)

Image Analyst
Image Analyst el 12 de Mayo de 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 el 12 de Mayo de 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.

Categorías

Más información sobre Low-Level File I/O en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by