フィルターのクリア

Reading HEX data from text file in HEX format not decimal.

69 ビュー (過去 30 日間)
Shivani Agarwal
Shivani Agarwal 2020 年 9 月 28 日
回答済み: Sudhakar Shinde 2020 年 9 月 28 日
Hi
I want to import the HEX data from the attached text file.
fid = fopen('hextest.txt');
data = fscanf(fid,'%x');
The output I am getting is:
3270305859.00000
3511556276.00000
4252643137.00000
900076204
829539893
3804738329.00000
3267229653.00000
but output I want is:
C2ECE843
D14E18B4
.
.
so on(means directly HEX values not their decimal equivalent)
Can someone please help me for this

採用された回答

Sudhakar Shinde
Sudhakar Shinde 2020 年 9 月 28 日
you could use textscan function:
fid = fopen('hextest.txt');
data = textscan(fid, '%s')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by