필터 지우기
필터 지우기

Write a for loop that converts the Data (Data.data) in the text file into matrix of 13 by 31 or 31 by 13.

조회 수: 3 (최근 30일)
The data should be imported and converted into a matrix of 13 x 31.

채택된 답변

DGM
DGM 2022년 4월 12일
This should be one way:
alltext = split(fileread('Textfile.txt'),newline);
allnums = regexp(alltext(1:end-1),'(?<=:\s*)[+-E\d]+','match');
allnums = cellfun(@str2double,allnums);
allnums = reshape(allnums,13,[])
  댓글 수: 2
DGM
DGM 2022년 4월 12일
for k = 1
alltext = split(fileread('Textfile.txt'),newline);
allnums = regexp(alltext(1:end-1),'(?<=:\s*)[+-E\d]+','match');
allnums = cellfun(@str2double,allnums);
allnums = reshape(allnums,13,[])
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by