How to save data from a file with text and numbers?
이전 댓글 표시
I have to load a file to Matlab with words and numbers and perform few operations. Structure of the file to be loaded is as follows:
Step
0
Number
1000
Box Dimension
0 10 0
10 0 0
0 0 10
ID Type
1 2
2 3
3 1
.....
i need to load this file and save lines starting from 'Step' to 'ID Type' to another file. Is it possible to do such operations in MATLAB?
댓글 수: 2
Mathieu NOE
2021년 5월 15일
sure
use readlines or fileread
T = fileread('data2.txt');
TT = split(T);
% or
TTT = readlines('data2.txt');
per isakson
2021년 5월 15일
Here the tags shall not have a leading #.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!