How do I select a y value by a certain x datetime
Mostrar comentarios más antiguos
Dear all,
I need to find the y value by a certain x datetime.
If h is my datetime and I try:
y(h);
It does not work. Do I need to convert the datetime? If I have to how should I do it then?
1 comentario
YT
el 6 de Nov. de 2018
Could you clarify your variables with examples? What exactly is y and can you give an example? And what does h look like?
Respuestas (2)
Daan Boot
el 6 de Nov. de 2018
You could try to use 'find'. 'find' gives you the index of the datetime, and thus the index of the y you need.
y(find(h==datetime))
Peter Perkins
el 15 de Nov. de 2018
0 votos
This is the kind of thing you can do with a timetaqble, but without more information, it's hard to say for sure. timetables do support subscripting by time.
Categorías
Más información sobre Data Type Conversion 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!