coeffvalues
cfit
或 sfit
对象的系数值
说明
示例
获得二次多项式曲线的系数值
加载 census.mat
文件中的数据,并为二次多项式曲线构造一个 fittype
。
load census f = fittype('poly2');
获取 fittype
对象 f
的系数名称和公式。
coefficientNames = coeffnames(f)
coefficientNames = 3x1 cell
{'p1'}
{'p2'}
{'p3'}
formula(f)
ans = 'p1*x^2 + p2*x + p3'
对数据进行曲线拟合,并检索系数值。
c = fit(cdate,pop,f); coefficientValues = coeffvalues(c)
coefficientValues = 1×3
104 ×
0.0000 -0.0024 2.1130
输入参数
fun
— cfit
或 sfit
对象
cfit
| sfit
要计算其系数的对象,指定为 cfit
或 sfit
对象。
输出参量
coeffvals
— 系数值
标量 | 向量
cfit
或 sfit
对象 fun
的系数值,以标量或向量形式返回。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)