Does in-equality operators work in comparison of two time format?
1 view (last 30 days)
Show older comments
Hi all, I am wondering does in-equality operators such as <= >= works if I want to compare two time format? if not is there any solution for that?
my problem is that I have time threshold , say upp_lim= 21:43:12 and low_lim=21:44:12 and I have a sample_time time_e_rad(j,:)= 21:45:53 , which I want to check if it is in the range of Upp_lim and low_lim
here is my code:
if((datenum(time_e_rad(j,:)<datenum(upp_lim))) && (datenum(time_e_rad(j,:)>=datenum(low_lim))))
but it gives me error.
any idea is appreciated .
0 Comments
Accepted Answer
Iain
on 25 Jun 2013
You have your brackets in the wrong places.
(datenum(time_e_rad(j,:))< datenum(upp_lim)) && (datenum(time_e_rad(j,:)) >= datenum(upp_lim))
0 Comments
More Answers (0)
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!