Convert values in text file into matrix
조회 수: 3 (최근 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에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!