extend prediction bounds curves

hello, in this code curve fitted is extended for 500 steps beyond. I want the prediction bounds curves to be extend too. tks very much:
%% Fit: 'fit plot'.
[xData, yData] = prepareCurveData( [], EU );
% Set up fittype and options.
ft = fittype( 'poly3' );
opts = fitoptions( 'Method', 'LinearLeastSquares' );
opts.Normalize = 'on';
opts.Robust = 'Bisquare';
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );
% Plot fit with data.
figure( 'Name', 'untitled fit 1' );
plot( fitresult, xData, yData, 'predobs', 0.99 );
% Extend the plot
hold on
xNew = linspace(max(xData), max(xData)+500, 500);
yNew = feval(fitresult, xNew);
plot(xNew, yNew);
% Label axes
ylabel('Interpreter', 'none' );
grid on

回答 (1 件)

Image Analyst
Image Analyst 2023 年 3 月 28 日

0 投票

I'd just use polyfit() to get the equations that fit your data. Once you have that equation, you can get values anywhere you want. See attached demo. Attach your own data if you can't figure out how to adapt it.

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

製品

リリース

R2022b

質問済み:

2023 年 3 月 28 日

回答済み:

2023 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by