Please help!!!! Write a function that returns the number of days between dates

 Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 19 Nov. 2016
Bearbeitet: Andrei Bobrov am 19 Nov. 2016
days_between_dates = @(month1,day1,year1,month2,day2,year2)...
abs(datenum(year1,month1,day1) - datenum(year2,month2,day2));
or
days_between_dates = @(month1,day1,year1,month2,day2,year2)...
abs(diff(datenum([year1,month1,day1;year2,month2,day2])));
use:
>> days_between_dates(10,12,2015,9,5,2016)
ans =
329
>>

Weitere Antworten (0)

Kategorien

Tags

Gefragt:

am 18 Nov. 2016

Bearbeitet:

am 20 Nov. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by