How is it possible that a fitobject can used as an input for the plot function?

1 次查看(过去 30 天)
How is it possible that a fitobject can used as an input for the plot function?

回答(1 个)

Titus Edelhofer
Titus Edelhofer 2015-9-17
That's because the fit object has a method called plot:
x = fit([1 2 3]', [4 5 6.5]', 'linear')
x =
Linear interpolant:
x(x) = piecewise polynomial computed from p
Coefficients:
p = coefficient structure
You can use which to find out:
which plot(x)
C:\MATLAB\R2015b\toolbox\curvefit\curvefit\@cfit\plot.m % cfit method
Other objects define a plot method as well:
which -all plot
built-in (C:\MATLAB\R2015b\toolbox\matlab\graph2d\plot)
C:\MATLAB\R2015b\toolbox\curvefit\curvefit\@cfit\plot.m % cfit method
C:\MATLAB\R2015b\toolbox\matlab\graphfun\@graph\plot.m % graph method
C:\MATLAB\R2015b\toolbox\matlab\graphfun\@digraph\plot.m % digraph method
C:\MATLAB\R2015b\toolbox\matlab\polyfun\@alphaShape\plot.m % alphaShape method
C:\MATLAB\R2015b\toolbox\matlab\timefun\@duration\plot.m % duration method
C:\MATLAB\R2015b\toolbox\matlab\timefun\@datetime\plot.m % datetime method
C:\MATLAB\R2015b\toolbox\curvefit\curvefit\@sfit\plot.m % sfit method
C:\MATLAB\R2015b\toolbox\finance\ftseries\@fints\plot.m % fints method
C:\MATLAB\R2015b\toolbox\ident\ident\@iddata\plot.m % iddata method
C:\MATLAB\R2015b\toolbox\ident\nlident\@idnlhw\plot.m % idnlhw method
C:\MATLAB\R2015b\toolbox\ident\nlident\@idnlarx\plot.m % idnlarx method
C:\MATLAB\R2015b\toolbox\robust\rctobsolete\robust\@frd\plot.m % frd method
C:\MATLAB\R2015b\toolbox\signal\signal\@dspdata\plot.m % dspdata method
C:\MATLAB\R2015b\toolbox\stats\classreg\@LinearModel\plot.m % LinearModel method
C:\MATLAB\R2015b\toolbox\matlab\timeseries\@timeseries\plot.m % timeseries method
C:\MATLAB\R2015b\toolbox\wavelet\wavelet\@wdectree\plot.m % wdectree method
C:\MATLAB\R2015b\toolbox\wavelet\wavelet\@ntree\plot.m % ntree method
C:\MATLAB\R2015b\toolbox\wavelet\wavelet\@dtree\plot.m % dtree method
C:\MATLAB\R2015b\toolbox\wavelet\wavedemo\@wvtree\plot.m % wvtree method
C:\MATLAB\R2015b\toolbox\wavelet\wavedemo\@rwvtree\plot.m % rwvtree method
C:\MATLAB\R2015b\toolbox\wavelet\wavedemo\@edwttree\plot.m % edwttree method
Titus

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by