Cannot use find() inorder to find the index of a time in datetime array
5 views (last 30 days)
I was trying to find the index of a particular time having datetime format (attached here as time.mat). I tried the usual find() inorder to find the index of an element but am constantly getting a 0×1 empty double column vector.
For example, I tried the following.
time=t.a; % a: [101×1 datetime]
index = find(time=='02-Dec-2014 07:05:25')
which gives me
0×1 empty double column vector.
Not sure why that is happening even though '02-Dec-2014 07:05:25' is present as the last element in the array.
Thank you for any help.