Azzera filtri
Azzera filtri

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

8 visualizzazioni (ultimi 30 giorni)
Dhruv Bhatnagar
Dhruv Bhatnagar il 7 Nov 2020
Commentato: Ameer Hamza il 11 Nov 2020
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

Risposte (1)

Ameer Hamza
Ameer Hamza il 7 Nov 2020
Modificato: Ameer Hamza il 7 Nov 2020
Try something like this
str = fileread('data.txt');
data = textscan(str, '%x')
data.txt used in my code is attached.
  21 Commenti
Ameer Hamza
Ameer Hamza il 11 Nov 2020
I am glad to be of help!!!

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by