问下matlab 中 nlinfit怎么用

问题描述:

问下matlab 中 nlinfit怎么用
nlinfit怎么用呢 什么情况下使用 求出的是什么
有例子么
1个回答 分类:综合 2014-09-26

问题解答:

我来补答
x=[1.1389 1.0622 0.9822 0.934 0.9251 0.9158];
y=[0.03 1 5.03 15.05 19.97 30.3];
拟合函数为y=-k*ln(x+a)-b;
nlinfit 非线性参数拟合
clc;clear;
x=[1.1389 1.0622 0.9822 0.934 0.9251 0.9158];
y=[0.03 1 5.03 15.05 19.97 30.3];
myfunc=inline('-beta(1)*log(x+beta(2))-beta(3)','beta','x');
beta=nlinfit(x,y,myfunc,[0 0 0]);
k=beta(1),a=beta(2),b=beta(3)
%test the model
xx=min(x):max(x);
yy=-k*log(x+a)-b;
plot(x,y,'o',x,yy,'r')
 
 
展开全文阅读
剩余:2000