I have produced a spectrogram of a signal, starting at 18:33:01 UTC on 6th July 2013. I need the time to be in UTC rather than time instants; does anybody know how to convert this?
Any help would be appreciated.

2 件のコメント

dpb
dpb 2019 年 3 月 26 日
Can you more fully explain what you mean by "rather than time instants"?
Harry Bell
Harry Bell 2019 年 3 月 26 日
I have defined my spectrogram as
[s,f,t,p] = spectrogram(bz,win,overlap,nfft,sample_freq);
where bz is the signal I am investigating. This returns "t" as a vector of time in seconds from the start of the dataset. I would like to plot UTC time rather than t.

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

 採用された回答

Walter Roberson
Walter Roberson 2019 年 3 月 26 日
編集済み: Walter Roberson 2019 年 3 月 26 日

0 投票

starttime = datetime('18:33:01 UTC 6th July 2013', 'InputFormat', 'HH:mm:ss ''UTC'' dd''th'' MMMM yyyy', 'TimeZone', 'UTC');
event_times = starttime + seconds(t);
plot(event_times, ...)
One hopes that in reality you have your starting time in a format that is easier to parse: the above is a bit weak for the possibility of "1st" or "2nd" or "21st" or "22nd" or "23rd".

1 件のコメント

Harry Bell
Harry Bell 2019 年 3 月 29 日
Hi Walter, thank you very much!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime-Frequency Analysis についてさらに検索

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by