How can I detect the third saturday of each month?

2 ビュー (過去 30 日間)
Adriano
Adriano 2017 年 2 月 21 日
コメント済み: Adriano 2017 年 2 月 22 日
Hello everyone! I have the follow vector of date-number:
734321 734328 734336 734342 734349 734356 734363 734371 734377 734384 734391 734399 734405 734412 734419 734427 734433 734440 734447 734454 734462 734468 734475 734482 734490 734495 734503 734510 734517 734525 734531 734538 734545
I need to remove from the array each dates (numbers) who aren't the third saturday of the month. How can I do? Many thanks!

採用された回答

Jan
Jan 2017 年 2 月 21 日
編集済み: Jan 2017 年 2 月 21 日
d = [734321 734328 734336 734342 734349 734356 734363 734371 734377 ...
734384 734391 734399 734405 734412 734419 734427 734433 734440 ...
734447 734454 734462 734468 734475 734482 734490 734495 734503 ...
734510 734517 734525 734531 734538 734545];
dSaturday = d(weekday(d) == 7); % Saturdays only
dv = datevec(dSaturday);
dThird = d(dv(:, 3) >= 15 & dv(:, 3) <= 21);
  1 件のコメント
Adriano
Adriano 2017 年 2 月 22 日
It works! Many thanks Jan Simon

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by