Info

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

How i plot these values in Matlab 2015 version?

조회 수: 1 (최근 30일)
SOMNATH MAHATO
SOMNATH MAHATO 2020년 10월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
Time Allystar M8T F9P LS
15:27:31 -0.1788 -0.1246 -0.1553 -0.1248
16:27:31 -0.3784 -0.0922 0.0863 -0.1232
17:27:31 -0.026 0.0978 0.2577 0.3321
18:27:31 -0.0607 -0.149 -0.0981 0.0831
19:27:31 -0.9248 -0.6555 -0.7323 -0.745
20:27:31 -0.2253 -0.1903 -0.3662 -0.3096
21:27:31 -0.2381 -0.2125 -0.3155 -0.3181
22:27:31 -0.4784 -0.4363 -0.2506 -0.4413

답변 (1개)

Walter Roberson
Walter Roberson 2020년 10월 13일
readtable().
In your version, those durations will come across as character vectors, and you will not (in your version) just be able to pass them to duration() in order to convert to HMS. However, you can
cell2mat(cellfun(@(s) sscanf(s, '%d:%d:%d', [1 inf]), Table.Variable, 'uniform', 0))
and pass that to duration() [you might have to split the columns into individual arguments.)
  댓글 수: 2
SOMNATH MAHATO
SOMNATH MAHATO 2020년 10월 13일
Thanks for your responce.
But it shows error.
If i change the time with numerical values then how it works. if posible send to me details programme.
Time Allystar M8T F9P LS
1 -0.1788 -0.1246 -0.1553 -0.1248
2 -0.3784 -0.0922 0.0863 -0.1232
3 -0.026 0.0978 0.2577 0.3321
4 -0.0607 -0.149 -0.0981 0.0831
5 -0.9248 -0.6555 -0.7323 -0.745
6 -0.2253 -0.1903 -0.3662 -0.3096
7 -0.2381 -0.2125 -0.3155 -0.3181
Walter Roberson
Walter Roberson 2020년 10월 13일
Eek, your version was pretty primitive on reading table formats compared to current versions!
filename = 'allystar.txt';
fid = fopen(filename, 'rt');
tcell = textscan(fid, '%s%f%f%f%f', 'headerlines', 1);
fclose(fid);
t = table(tcell{:}, 'variablenames', {'Time', 'Allystar', 'M8T', 'F9P', 'LS'});
timeparts = cell2mat(cellfun(@(s) sscanf(s, '%d:%d:%d', [1 inf]), t{:,1}, 'uniform', 0));
t.times = duration(timeparts(:,1), timeparts(:,2), timeparts(:,3));
plot(t.times, t.Allystar, t.times, t.M8T, t.times, t.F9P, t.times, t.LS);
legend({'Allystar', 'M8T', 'F9P', 'LS'})

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by