How to delete rows from a TimeSeries variable

Hello everyone,
I have a 1x1 double TimeSeries variable.
The size of both columns are 812997x1.
I want to exclude every rows indexed after and including the row number 664410.
How can I do it?
I've tried doing it like in a normal matrix but it obviously doesn't work:
HRTimeSeries.time(664410:end,:) = [ ];

 採用された回答

dpb
dpb 2020 年 3 月 14 日
編集済み: dpb 2020 年 3 月 14 日

0 投票

delsample
timeseries are different...only can address by the time values or events, not linear indexing. I've never found them helpful; use timetable or regular table instead for virtually any purpose unless the event feature is really suited for your specific purposes.

2 件のコメント

Happy Bear
Happy Bear 2020 年 3 月 16 日
Yes, using delsample is indeed an option.
However, I ended up just overwriting my timeseries.
HRTimeSeries = timeseries(HRTimeSeries.data(1:664410-1), HRTimeSeries.time(1:664410-1));
dpb
dpb 2020 年 3 月 16 日
That's pretty easy to write for the specific case, "not so much" if a row stuck down in the middle somewhere...

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2020 年 3 月 14 日

コメント済み:

dpb
2020 年 3 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by