Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Determine whether a column in a Table contains time data

1 visualización (últimos 30 días)
Aniruddha
Aniruddha el 2 de Feb. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
How can I determine whether a column in a Table is a time vector? In addition, how can I ensure that all rows in this column have the same time series format?

Respuestas (1)

Iddo Weiner
Iddo Weiner el 2 de Feb. de 2017
Please define "time vector" - do you mean that the numbers should simply be monotonically increasing? or do you also have a certain "time format" / "time pattern" you're looking for ? If it's the first option, the solution is simple enough:
function out = is_monotonically_increasing(vector)
if sum (vector(2:end) - vector(1:end-1) <= 0) > 0
Out = 0;
else
Out = 1;
end
end
If you need something more specific please describe more thoroughly
  3 comentarios
Iddo Weiner
Iddo Weiner el 4 de Feb. de 2017
Absolutely! Aniruddha - are you there? does this help? Or do you have different specifications?

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by