How to read only numerical values of serial output data in MATLAB?
조회 수: 1 (최근 30일)
이전 댓글 표시
I just want to read the integer values (number) in the output text file (serial data)...... I need some assistance.....
댓글 수: 0
채택된 답변
Walter Roberson
2021년 11월 8일
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/791754/Log_file.txt';
data = readmatrix(filename, 'Range', 'C:C')
댓글 수: 0
추가 답변 (2개)
Yongjian Feng
2021년 11월 6일
Your data file looks like a configuration file with key/value pair separated by ':'. One way to parse the data is to do this for each row:
rowStr = 'ADC0/F1 : 1562';
tokens = split(rowStr, ':');
intValue = str2double(strtrim(tokens(2)));
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!