フィルターのクリア

Insert value for the last day of the year

2 ビュー (過去 30 日間)
BdS
BdS 2020 年 1 月 27 日
回答済み: dpb 2020 年 1 月 27 日
Hi,
enclosed you will find a 1044x1 datetime vector (weekly data).
I would like to create a logical vector containing 1 for the last data point of each year.
Do you have any suggestions?
Thank you for your help.

採用された回答

dpb
dpb 2020 年 1 月 27 日
May be a neat way with the builtin datetime lookup functions, but first thing that comes to mind is
isyrlast=false(size(dates));
isyrlast(arrayfun(@(y) find(year(dates)==y,1,'last'),unique(year(dates))))=true;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistorical Contests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by