I have this image taken from user Li-aung Yip, in his response: Is there a way to do a linear best fit from one point to another in a matrix multiple times in order to detrend a series, MatLab?
I would like to know given several time series how MatLab can do this.
Best, Abid
Assuming that the original plots (red,green,black,blue) are of variables a,b,c,d
, each of which has a point for each t
:
figure;
hold on
plot(t,c,'-k'); %# black line
plot(t,c+b,'-g'); %# green line added to previous
plot(t,c+b+a,'-r'); %# red line added to previous
plot(t,c+b+a+d,'-b'); %# blue line added to previous