Azzera filtri
Azzera filtri

Does in-equality operators work in comparison of two time format?

2 visualizzazioni (ultimi 30 giorni)
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 .

Risposta accettata

Iain
Iain il 25 Giu 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))

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by