Convert values in text file into matrix
9 次查看(过去 30 天)
显示 更早的评论
How to convert values in a text file to 80*64 matrix? Text file is attched.
0 个评论
采纳的回答
Voss
2022-3-18
This file contains 5120 numbers on a single line, so the matrix is of size 1-by-5120:
A = readmatrix('textT.txt','Delimiter',' ')
2 个评论
Voss
2022-3-18
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!