Convert a .txt file into .mat fiie in MATLAB.

조회 수: 4 (최근 30일)
Dhruv Bhatnagar
Dhruv Bhatnagar 2020년 11월 7일
댓글: Ameer Hamza 2020년 11월 11일
Dear Members I am new to MATLAB.
I have one .txt file containg information in hex format as given below:
1234ABC6789D
AB456C78DEF
......
Like this almost 1000 values are there.
I want to write it in matrix format in matlab.
So can someone please explain how to convert this .txt file into .mat file

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 11월 7일
편집: Ameer Hamza 2020년 11월 7일
Try something like this
str = fileread('data.txt');
data = textscan(str, '%x')
data.txt used in my code is attached.
  댓글 수: 21
Dhruv Bhatnagar
Dhruv Bhatnagar 2020년 11월 11일
Thank You Sir
Ameer Hamza
Ameer Hamza 2020년 11월 11일
I am glad to be of help!!!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by