フィルターのクリア

How to Load a Binary File without translation

2 ビュー (過去 30 日間)
Fritz Sonnichsen
Fritz Sonnichsen 2012 年 6 月 21 日
I have a file which is binary data from in instrument. I want to load the data into matlab and then do some searches on it, comparing against some hex strings. I cannot seem to load the file. I have tried for example:
fread(fileID)
fread(fileiD,'int')
a=fscanf(fileID,'%x %x %x %x %x %x')
These seem to store the file as 3 digit ASCII encoding numbers. Not what I need here-just the raw data. Can anyone tell me how to do this?
Thanks,
Fritz

採用された回答

Walter Roberson
Walter Roberson 2012 年 6 月 21 日
Is it a file stored on disk? If so then
a = fileread('YourFileName.txt');
If you are reading it from an instrument then loop using fgetl(fileID) until you determine that you have reached the end of that output.
  1 件のコメント
Fritz Sonnichsen
Fritz Sonnichsen 2012 年 6 月 22 日
Thanks Walter!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by