Convert values in text file into matrix
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Neha Tom Merin
am 18 Mär. 2022
Kommentiert: Voss
am 18 Mär. 2022
How to convert values in a text file to 80*64 matrix? Text file is attched.
0 Kommentare
Akzeptierte Antwort
Voss
am 18 Mär. 2022
This file contains 5120 numbers on a single line, so the matrix is of size 1-by-5120:
A = readmatrix('textT.txt','Delimiter',' ')
2 Kommentare
Voss
am 18 Mär. 2022
A = readmatrix('textT.txt','Delimiter',' ')
A = reshape(A,80,64) % numbers in the file go down the first column of A first
or perhaps
A = reshape(A,64,80).' % numbers in the file go across the first row of A first
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!