The answer for '29-Feb-1970' should probably be NaN
To solve the issue with the birthday year that falls on '29-Feb-1970' (and all such leap years), use the MATLAB function datestr(x) in place of x in the regexprep while condition loop to convert such b'day years to the correct '01-Mar-1970'. P.S. You can then delete the cheating section and at least get a Cody score of 26.
THX,man. But I did not know datestr have this useage. at that time I just thought this problem is flawed.and not consider this code is cheated.
PS: like the function you use( not gonna tell it for spoil-free), it is actully nice.
First N Perfect Squares
Project Euler: Problem 10, Sum of Primes
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
Area of an equilateral triangle
Side of a rhombus
Matrix rotation as per given angle
Back to basics - array operations
Create a v-notch vector without "sort" function
Find offset of given matrix element from first matrix element
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office