smart way for grouping condition
Ältere Kommentare anzeigen
Hi all,
I have a two column matrix, A. In the first column I store the values of years, e.g. 2011, 2012, etc., and in the second column there are the values of monhts, 1, 2...,12. I want to pick all the values that belong within a specific range, lets say from 3/2014 to 9/2015. I have tried the following in order to group my conditions but... it calculates sth different:
( a(:, 1) > yearStart & a(:, 2) > monthStart ) & ( a(:, 1) > yearEnd & a(:, 2) > monthEnd )
Actually the above code takes the values between 2014-2015 and between months 3-9.
Is there a clever way to do this?
Thank you in advance,
Elric
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!