How to get full day data from time sample

조회 수: 1 (최근 30일)
rabih Al Ahmadieh
rabih Al Ahmadieh 2015년 10월 9일
댓글: Star Strider 2015년 10월 9일
Hi if I have data like [1 2 3 4 5] at time [1 5 12 15 19] how can I get for example the data at time 2 or 3 or even 24. I tried to plot a graph but could not get the data out from the graph because the xdata and ydata will be similar to the input points. If you can help I would appreciate it. Thank you,

채택된 답변

Star Strider
Star Strider 2015년 10월 9일
I would use the interp1 function:
time = [1 5 12 15 19];
data = [1 2 3 4 5];
new_data = interp1(time, data, [2 3 24], 'linear', 'extrap');
  댓글 수: 2
rabih Al Ahmadieh
rabih Al Ahmadieh 2015년 10월 9일
Thank you very much
Star Strider
Star Strider 2015년 10월 9일
My pleasure.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by