smart way for grouping condition
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Dates and Time en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!