fopen gives error msg for a binary file

1 回表示 (過去 30 日間)
vijay vyas
vijay vyas 2017 年 2 月 23 日
編集済み: Walter Roberson 2017 年 2 月 23 日
I have a set of binary files loaded from a old hard drive that I can see using binary-file-viewer program. Yet, the code
[Fid,message] = fopen(fnames.name,'r');
generates Fid=-1 and error message "no such file _ _ _". I can see the filename and other characteristics in matlab command windows! What's strange is that if I point the directory to a different set of binary files, all is well! Please note that the filenames in both cases are about 18 to 21 characters long and suffix is .dat in both cases. Completely stumped!

回答 (1 件)

James Tursa
James Tursa 2017 年 2 月 23 日
編集済み: James Tursa 2017 年 2 月 23 日
Are there any funny non-displaying characters in the file names? E.g., what does this show:
d = dir;
d = [d.name];
any(d<' ')
or
dir(fnames.name)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by