function date_day(y,m,d)
p=-1;
if nargin<3
disp('Not enough input');
elseif fix(y)~=y|fix(m)~=m|fix(d)~=d
disp('Input must be integers');
elseif m>12|m<=0
disp('Month must be a number from 1 to 12');
elseif d<=0|d>31
disp('Day must be a number from 1 to 31');
else
p=0;
if(mod(y,4)==0&mod(y,100)~=0)|mod(y,400)==0
p=1;
end
switch(m)
case {4,6,9,11}
if d==31
disp('Not exist this day');
p=-1;
end
case 2
if d>28+p
disp('No exist this day');
p=-1;
end
end
end
if p~=-1
if m<=2
sum=(m-1)*31+d;
else
a(11)=0;a(1:(m-1))=1;b=[31 28 31 30 31 30 31 31 30 31 30 31];sum=d;
for i=1:11
sum=sum+a(i)*b(i);
end
sum=sum+p;
end
disp('sum=');disp(sum);
end
年份输入是负的是不是就当是公元前
OldHandle = findobj( \'Name\', \'悲伤\' ) ;if ~isempty(OldHandle),delete(OldHandle) ;end
for Time = \'现在\':\'每一天\':\'永远\',set( gco, \'心情\', \'快乐\');end % 这段代码为你天天快乐而存在