Info

此问题已关闭。 请重新打开它进行编辑或回答。

Fitting line through data points

1 次查看(过去 30 天)
Ede gerlderlands
Ede gerlderlands 2012-11-6
I want to fit the three intermediate series data seriesI have so that I will have long time series data. Each of the data contain 26 values(total of 78) at different time and I want to extend (fit) these data upto hTime= 25000.
The three data I have, which contains 26 values are in equation form
i-2.327+0.6.*(1:25) %% starts at time , tni= 11707
ii-1.492+ 0.46.*(1:25) %% starts at time , tmi= 16400
iii-1.2+ 0.3.*(1:25) %% starts at time , tgi= 23200
Here is the script I tried to work upon and failed.
hTime=linspace(1,1,25000);
time=linspace(1,1,25);
for rr= 1:length(time);
tni= 11707; tmi=16400; tgi=23200;
tnii=tni:(tni+24);tmii=tmi:(tmi+24);tgi=tgi:(tgi+24);
p=polyfit([tnii tmii tgi],[(2.327+0.6.*(rr)) (1.492+ 0.46.*(rr)) (1.2+ 0.3.*(rr))]);
[cofp,sts]=polyval(p,1:length(hTime));
end
Any help is highly appreciated.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by