Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to plot data from a text file with variable delimeters.

조회 수: 1 (최근 30일)
Billy Bussah
Billy Bussah 2019년 2월 14일
마감: MATLAB Answer Bot 2021년 8월 20일
i need help on how to plot x against Cp from thr following text file, since the delimters vary. thanks.

답변 (1개)

Bob Thompson
Bob Thompson 2019년 2월 14일
Others may have a better solution, but because of the varying delimiters I think you may have a better time with just loading the file in as a string, and using regexp to break the string into different parts.
fid = fopen(['tempCpData.txt']);
A = fread(fid, Inf, 'uint8=>char');
fclose(fid);
Fmt = repmat('%02X ', 1, 16); % Create format string
Fmt(end) = '*'; % Trailing star
S = sprintf(Fmt, A); % One long string
C = regexp(S, '*', 'split'); % Split at stars
Some of this stuff is fairly specific to a different database I was working with, but it should give you an idea of how to get started.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by