How to set a range to plot(fittedmodel)

I have plotted a graph and generated a fitting with MATLAB curve fitting app.
When i use plot(fittedmodel), the curve fit goes to infinity. I would like to set a range on which the fitting curve will be plotted.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 12월 16일

0 개 추천

Instead of using plot() of the fit object, use linspace() to generate a range of x values, and pass the range into the fit object
MyFitResult = fit(....);
x = linspace(0, 2.2);
y = MyFitResult(x) ;
plot(x, y)

카테고리

도움말 센터File Exchange에서 Smoothing에 대해 자세히 알아보기

질문:

2021년 12월 16일

답변:

2021년 12월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by