请问Matlab多变数nlinfit用法,请高手务必帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/17 16:03:09
题目是这样的: 我有个方程式 y=a*n^b*tanh(x)^c
x是自变数,y为应变数,a.b.c为系数,但n为两个数目。这样讲可能很复杂
举例来说: 我现在有的data是 分别当n=20及n=60时的x,y关系,因为这是两条线,我想要求出一条 fitting 的方程式可以来描述这两条线(只要我输入n=20或n=60)。

可是我看了 nlinfit的用法,包括网路上各位先进的帮忙与提示,却找不到有多一组变量的 nlinfit例子~请各位高手赐教!!
感谢回答!我已经有求出来我的nonlinear model了,只是我有个疑惑。这个 equation 跟原本离散点之相关系数该如何求? 是不是(beta,r,j,sigma,mse) =nlinfit..里面这个 mse ? 我意思是有没类似哪种 r^2= 0.981 这种的。还是得另外用指令去求取?

给出x、y的值,就用nlinfit

【补充】
'mse' The mean squared error returned by nlinfit. This is required to predict new observations (see 'predopt') if you used a robust option with nlinfit; otherwise the mse is computed from the residuals and does not take the robust fitting into account.

mse是平均平方差。
俺也想知道非线性回归的相关系数怎么求。