Friday the 13th - MATLAB Cody - MATLAB Central

Problem 1877. Friday the 13th

Difficulty:Rate

According to superstition, lots of unpleasant stuff happens on Friday the 13th, so you might like to find the next occurence of such a date. Given a date string ('dd/mm/yyyy'), return the next occurence of a Friday the 13th. If the date string is already a Friday the 13th, return the original string. Output should be in the form of a date string ('dd/mm/yyyy').

Example: date = '13/09/2013', nextfri13(date) = '13/09'2013'; date = '15/12/2013', nextfri13(date) = '13/06/2014';

And so on. Good luck!

Solution Stats

58.25% Correct | 41.75% Incorrect
Last Solution submitted on Mar 27, 2025

Problem Comments

Solution Comments

Show comments
Registration Now Open for MathWorks AUTOMOTIVE CONFERENCE 2025
...
Hello Community, We're excited to announce that registration is now open for the...

Problem Recent Solvers52

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page