Please explain to me why this code will not work.
function[d] = year2016(m)
if m<1 || m>12 || ~isscalar(m)|| m~=fix(m)
d = [];
else days = datenum([2016,m,1]):datenum([2016,m+1,1])-1;
date = 1 + mod(days-3,7);
month = {'January', 'february','March', 'April', 'May', 'June', 'July','August', 'September','October', 'November', 'December'};
day = {'Mon', 'Tue', 'Wed','Thu', 'Fri','Sat'};
x = day(date);
y = num2cell(1:numel(days));
z = month(m);
d = struct('day',x, 'date',y,'month',z);
end
Best Answer