error using fread

7 ビュー (過去 30 日間)
suzwani ismail
suzwani ismail 2012 年 5 月 12 日
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 件のコメント
Jan
Jan 2012 年 5 月 12 日
It is recommended to post the code, which causes the error. The size of the image is not helpful.

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2012 年 5 月 12 日
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 2012 年 5 月 12 日
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.

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by