필터 지우기
필터 지우기

How do I parse this given data in matlab

조회 수: 1 (최근 30일)
Sucharitha Chokkappa Gari
Sucharitha Chokkappa Gari 2020년 10월 8일
답변: Walter Roberson 2020년 10월 8일
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 10월 8일
Can you attach the data as text instead of an image?
Mathieu NOE
Mathieu NOE 2020년 10월 8일
hi
are you getting this by reading a txt / ascii file ? there are plenty of possibilities to red such files with matlab
how do you get this data ?
in worst case , you 'll end up to write directly data names and values either one by one or in a more structured way (cells, arrays)
read matlab help
have a look at

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 10월 8일
S = fileread('YourFileNameGoesHere.txt');
colon_matches = regexp(S, '^.*:\s*(?<v1>\S+)\s*(?<v2>\S+)', 'dotexceptnewline', 'lineanchors');
v1 = str2double({colon_matches.v1});
v2 = str2double({colon_matches.v2});
power_matches = regexp(S, '^\w+\s+(?<power>)', 'lineanchors');
p = str2double({power_matches.power});
header_vals = [v1(:), v2(:)];
power_vals = p(:);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by