How to set a range to plot(fittedmodel)

14 Ansichten (letzte 30 Tage)
Israel Ngoy
Israel Ngoy am 16 Dez. 2021
Beantwortet: Walter Roberson am 16 Dez. 2021
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.

Antworten (1)

Walter Roberson
Walter Roberson am 16 Dez. 2021
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)

Kategorien

Mehr zu Smoothing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by