Is it possible to calculate the number of days in a year without having to put the year? If so how? Also i'm doing this on an m-file.
No products are associated with this question.
I would go something like that:
firstDayInYear = '01/01/2012'; lastDayInYear = '31/12/2012';
firstDayInYearNum = datenum(firstDayInYear, 'dd/mm/yyyy'); lastDayInYearNum = datenum(lastDayInYear, 'dd/mm/yyyy');
numDaysInYear = lastDayInYearNum - firstDayInYearNum + 1;
Play games and win prizes!Learn more