フィルターのクリア

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