Function that transforms years into days

 Risposta accettata

Like this?
function numDay = year2days(year)
numDay = days(datetime(year,12,31)-datetime(year,1,1))+1;
end
The following is one example:
>> year2days(2000)
ans =
366

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by