Reading HEX data from text file in HEX format not decimal.
조회 수: 69 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Sudhakar Shinde
2020년 9월 28일
you could use textscan function:
fid = fopen('hextest.txt');
data = textscan(fid, '%s')
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!