A (simple) way to use ismember between datetime arrays with different formats?
Is there a (simple) way to use ismember between datetime arrays with different formats?
% Input
A = datetime(…
[’19-Jun-2023′,
’20-Jun-2023′,
’21-Jun-2023′,
’22-Jun-2023′,
’23-Jun-2023′,
’24-Jun-2023′,
’25-Jun-2023′]);
tmp = [{’23-Jun-2023 19:00:00′}
{’24-Jun-2023 16:00:00′}
{’24-Jun-2023 11:00:00′}
{’19-Jun-2023 16:00:00′}
{’20-Jun-2023 10:00:00′}
{’21-Jun-2023 10:00:00′}
{’22-Jun-2023 09:00:00′}
{’23-Jun-2023 14:00:00′}
{’19-Jun-2023 17:00:00′}
{’20-Jun-2023 11:00:00′}
{’21-Jun-2023 17:00:00′}
{’22-Jun-2023 15:00:00′}
{’23-Jun-2023 06:00:00′}
{’24-Jun-2023 11:00:00′}
{’25-Jun-2023 19:00:00′}
{’20-Jun-2023 11:00:00′}
{’21-Jun-2023 09:00:00′}
{’23-Jun-2023 12:00:00′}
{’25-Jun-2023 17:00:00′}
{’23-Jun-2023 12:00:00′}
{’22-Jun-2023 07:00:00′}];
B = datetime(tmp, ‘InputFormat’, ‘dd-MMM-yyyy HH:mm:ss’);
ismember(A,B)Is there a (simple) way to use ismember between datetime arrays with different formats?
% Input
A = datetime(…
[’19-Jun-2023′,
’20-Jun-2023′,
’21-Jun-2023′,
’22-Jun-2023′,
’23-Jun-2023′,
’24-Jun-2023′,
’25-Jun-2023′]);
tmp = [{’23-Jun-2023 19:00:00′}
{’24-Jun-2023 16:00:00′}
{’24-Jun-2023 11:00:00′}
{’19-Jun-2023 16:00:00′}
{’20-Jun-2023 10:00:00′}
{’21-Jun-2023 10:00:00′}
{’22-Jun-2023 09:00:00′}
{’23-Jun-2023 14:00:00′}
{’19-Jun-2023 17:00:00′}
{’20-Jun-2023 11:00:00′}
{’21-Jun-2023 17:00:00′}
{’22-Jun-2023 15:00:00′}
{’23-Jun-2023 06:00:00′}
{’24-Jun-2023 11:00:00′}
{’25-Jun-2023 19:00:00′}
{’20-Jun-2023 11:00:00′}
{’21-Jun-2023 09:00:00′}
{’23-Jun-2023 12:00:00′}
{’25-Jun-2023 17:00:00′}
{’23-Jun-2023 12:00:00′}
{’22-Jun-2023 07:00:00′}];
B = datetime(tmp, ‘InputFormat’, ‘dd-MMM-yyyy HH:mm:ss’);
ismember(A,B) Is there a (simple) way to use ismember between datetime arrays with different formats?
% Input
A = datetime(…
[’19-Jun-2023′,
’20-Jun-2023′,
’21-Jun-2023′,
’22-Jun-2023′,
’23-Jun-2023′,
’24-Jun-2023′,
’25-Jun-2023′]);
tmp = [{’23-Jun-2023 19:00:00′}
{’24-Jun-2023 16:00:00′}
{’24-Jun-2023 11:00:00′}
{’19-Jun-2023 16:00:00′}
{’20-Jun-2023 10:00:00′}
{’21-Jun-2023 10:00:00′}
{’22-Jun-2023 09:00:00′}
{’23-Jun-2023 14:00:00′}
{’19-Jun-2023 17:00:00′}
{’20-Jun-2023 11:00:00′}
{’21-Jun-2023 17:00:00′}
{’22-Jun-2023 15:00:00′}
{’23-Jun-2023 06:00:00′}
{’24-Jun-2023 11:00:00′}
{’25-Jun-2023 19:00:00′}
{’20-Jun-2023 11:00:00′}
{’21-Jun-2023 09:00:00′}
{’23-Jun-2023 12:00:00′}
{’25-Jun-2023 17:00:00′}
{’23-Jun-2023 12:00:00′}
{’22-Jun-2023 07:00:00′}];
B = datetime(tmp, ‘InputFormat’, ‘dd-MMM-yyyy HH:mm:ss’);
ismember(A,B) ismember, datetime, cell MATLAB Answers — New Questions