TR =
timetable timerange subscript:
Select timetable rows with times in the half-open interval:
[01-Dec-2020 00:00:00, 31-Dec-2023 00:00:00)
See Select Times in Timetable.
Y is timetable
5×1 timetable
Data Profit
__________ ______
2020-01-01 4075
2021-01-01 23420
2022-01-01 21292
2023-01-01 4725
2024-01-01 -887.5
prof_yearly=y(TR,:)
prof_yearly =
3×1 timetable
Data Profit
__________ ______
2021-01-01 23420
2022-01-01 21292
2023-01-01 4725
i don't see 2020-01-01 !!!

 採用された回答

Walter Roberson
Walter Roberson 2024 年 2 月 29 日

0 投票

The range starts 01-Dec-2020 which is after 2020-01-01

5 件のコメント

shamal
shamal 2024 年 2 月 29 日
編集済み: shamal 2024 年 2 月 29 日
Thanks, then I misunderstood how to use the function..
I want to recap and profits of each year..Can I code it?
Data Profit
__________ ______
2020-01-01 4075 Total in 2020 year
2021-01-01 23420 Total in 2021 year
2022-01-01 21292 Total in 2022 year
2023-01-01 4725 Total in 2023 year
Walter Roberson
Walter Roberson 2024 年 2 月 29 日
Make the timetable subscripts
[01-Jan-2020 00:00:00, 31-Dec-2023 23:59:59)
shamal
shamal 2024 年 3 月 1 日
Eq.Live.StartingDat
datetime
01-Dec-2020
iniz_=datetime(year(Eq.Live.StartingDate),1,1,0,0,0)
iniz_ =
datetime
2020-01-01
I solved it like this, thanks
Walter Roberson
Walter Roberson 2024 年 3 月 1 日
iniz = dateshift(Eq.Live.StartingDat, 'start', 'year');
shamal
shamal 2024 年 3 月 1 日
thank

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTimetables についてさらに検索

質問済み:

2024 年 2 月 29 日

コメント済み:

2024 年 3 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by