Plot time in format 00:00:00

4 ビュー (過去 30 日間)
nas illmatic
nas illmatic 2019 年 8 月 14 日
コメント済み: Jess Lovering 2019 年 8 月 19 日
I am trying to plot time on the x-axis and on the y an amplitude (in this case 1 as an example) in the following format: however, following code breaks and an attempt to google led to datetime and prefixing that to the time format of not work nor did datestr
Plot([00:02:37.96469 00:02:38.93659], [1 1], bx)
  4 件のコメント
Adam Danz
Adam Danz 2019 年 8 月 16 日
Look at this.
>> [00:02:37.96469 00:02:38.93659]
ans =
Columns 1 through 22
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 0 2 4
Columns 23 through 39
6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38
Where did this ">> [00:02:37.96469 00:02:38.93659]<<" come from? Did you just type that in?
nas illmatic
nas illmatic 2019 年 8 月 16 日
Yes that’s the time I want to plot and yes I just typed that in

サインインしてコメントする。

回答 (1 件)

Jess Lovering
Jess Lovering 2019 年 8 月 14 日
Have you tried to use the duration function?
plot(duration({'00:02:37.96469', '00:02:38.93659'}), [1 1], 'bx')
  8 件のコメント
Walter Roberson
Walter Roberson 2019 年 8 月 17 日
tr = duration(0,2, [37,38],[96469,93659]/100, 'Format', 'mm:ss.SSSSSS');
plot(tr, [1 1], 'bx')
Jess Lovering
Jess Lovering 2019 年 8 月 19 日
I use 2019a so I am not sure if this will be the same, but I am able to change the x-axis format with this command:
h = gca;
h.XAxis.TickLabelFormat = 'mm:ss.SSSSSS';

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by