Interpolating(or averaging) Time series curves

3 次查看(过去 30 天)
Hi all, I have two time-series curves (blue and red as shown in the picture) corresponding to two different conditions (T=800, T=900). I would like to make an averaging of the two curves (or interpolation?) to get a curve like the black indicated in the picture corresponding to T=850. Do you have any suggestion how to do it? I was unable to get a code to reproduce the black curve numerically.
Do you think machine learning could be an option?
Many thanks
Input Data:
Red Curve:
0 0
5 0,0100000000000000
5,20000000000000 0,300000000000000
5,30000000000000 10
14 9,80000000000000
14,5000000000000 19
50 17
Blue Curve:
0 0
5 0,0100000000000000
5,20000000000000 0,300000000000000
5,30000000000000 10
10 9,80000000000000
10,5000000000000 19
50 17

采纳的回答

Mathieu NOE
Mathieu NOE 2022-7-19
hello
in your case it's fairly simple as both blue and red curves have exactly the same y values (but for different x)
so you simply need to do the mean of y blue and red and yu're done !
in case the two data sets would not share the same y values it would be a different situation (but it's also feasible)
%Red Curve:
rc = [0 0;
5 0.01;
5.2 0.30;
5.3 10;
14 9.80;
14.5 19;
50 17];
xr = rc(:,1);
yr = rc(:,2);
% Blue Curve:
bc = [0 0;
5 0.01;
5.2 0.30;
5.3 10;
10 9.80;
10.5 19;
50 17];
xb = bc(:,1);
yb = bc(:,2);
% plot red / blue / black curves
xk = (xr+xb)*0.5; % mean value
yk = (yr+yb)*0.5; % mean value
figure(1)
plot(xb,yb,'b',xr,yr,'r',xk,yk,'k')
  8 个评论
Testscan
Testscan 2022-7-19
Hello again! Thanks a lot for you effort! I have tried the code and it worked fine.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by