how to extract indices?

Hi,
I am trying to loop in time to extract it within the range of 23 to 1am and 11am to 13 using the following find function:
my problem is to do that for the days from 20 to 31 of March.
how can I loop over it? and extract the indices?
Note, the mtime is a 2D matrix which I need the first row for all column (1,:)
ntime=find(mtime>=datenum(2019,3,20,11,0,0) & mtime<=datenum(2019,3,20,13,0,0)...
& mtime>=datenum(2019,3,20,1,0,0) & mtime<=datenum(2019,3,20,23,59,0));

5 commentaires

Mathieu NOE
Mathieu NOE le 1 Fév 2021
Lilya
Lilya le 1 Fév 2021
Hi Mathieu, thanks for that! No I didn’t.. I am wondering if does it work for the conditions I gave?
Mathieu NOE
Mathieu NOE le 2 Fév 2021
hello
yes I think it should
Lilya
Lilya le 3 Fév 2021
It works perfectly!! many many thanks
Mathieu NOE
Mathieu NOE le 3 Fév 2021
glad it helped !

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Question posée :

le 1 Fév 2021

Commenté :

le 3 Fév 2021

Community Treasure Hunt

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

Start Hunting!

Translated by