⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curvefiteg2.m

📁 matlab高级统计工具箱
💻 M
字号:
 % script leasq example using curvefit
% generate some data for two t's
t1=[0.01:.01:1]';t2=[0.01:.01:1]'.*2;t=[t1,t2];
p=[.4 .5];% parameters
y=exp(-p(1).*t(:,1)).*sin(2*pi*p(2).*t(:,2));
yd=y+.01*randn(size(y));  %add noise
p0=[.3 .4]';	  %initial guess for parameters
[pfinal,options,error,jac]=curvefit('modelcurve2',p0,t,yd);
pfinal
ymodel=yd+reshape(error,size(yd));% error vector needs reshaping

% calc regression data
[std,varresid,r2,cor,vcv,varinf]=regdata(pfinal,ymodel,yd,jac);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -