Date is element of some period in MATLAB

2 views (last 30 days)
Hi
I have a question that bother me. If I have a date, lets say 10.2012, how can i check he is element of period beetwen 14.10.12 and 1.1.2013.
Thank you in advance
Nejc

Accepted Answer

Walter Roberson
Walter Roberson on 4 Apr 2013
pstart = datenum('14.10.2012', 'dd.mm.yyyy');
pend = datenum('1.1.2013', 'dd.mm.yyyy');
testdate = datenum('5.10.2012', 'dd.mm.yyyy');
if testdate >= pstart & testdate < pend
disp('in testing range')
end

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!