Extrapolate using half the slope than in original data
显示 更早的评论
I have a set of 21 X,Y poinst which I intend to extrapolate by using slope (rate of change)= 1/2 than that is observed in the original X,Y dataset.
The code thus far
Xext=22:82; (trying to extrapolate until limit= 82)
c = polyfit((X(end-8:end)), (Y(end-8:end)),1); % linear fit based on the last 8 points
c1=[c(1)/2, c(2)];%%making slope 1/2 of the original X,Y dataset
Yext = polyval(c1,Xext);
%%plotting to obtain a figure that shows the first 21 points changing at the observed rate and the next extrapolated to change at 1/2 its rate
Xn=[X,Xextrap(9:end)];
Yn=[Y,Yextrap(9:end)];
plot(Xn,Yn)
This makes a bit of an unwated hump where the extrapolation begins (see attached)
Any help is greatly appreciated
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
