How do I select a y value by a certain x datetime

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

YT
YT 2018년 11월 6일
Could you clarify your variables with examples? What exactly is y and can you give an example? And what does h look like?

댓글을 달려면 로그인하십시오.

답변 (2개)

Daan Boot
Daan Boot 2018년 11월 6일
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
Peter Perkins 2018년 11월 15일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2018년 11월 6일

답변:

2018년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by