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

5 ビュー (過去 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 Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by