日付の検証をチェックするためにこのコードを書きましたが、うるう年をチェックする方法に行き詰まっています。
date = '01/02/1990';
display('hello')
a=strsplit(date,'/');
day = a(1);
display(day);
%b=strsplit('/',date,'/');
month = a(2);
display(month);
%c=strsplit('/','/',date);
year = a(3);
display(year);
if (month==1||month==3||month==5||month==7||month==8||month==10||month==12)
if (day>=1&&day<=31)
display(' Its a valid date')
else
display(' Its NOT a valid date')
end
end
うるう年の計算を組み込むにはどうすればよいですか?