matlab编程问题,已知函数表达式和数据,求表达式中的系数
数据为t=[0.1,1.1,2.3,3.4,4.5,5.7,6.7];y=[0,94.0,84.0,77.0,69.0,62.0,56.0];所求函数形式为Ae-βtco...
数据为 t=[0.1,1.1,2.3,3.4,4.5,5.7,6.7]; y=[0,94.0,84.0,77.0,69.0,62.0,56.0];
所求函数形式为 Ae-βt cos(wt+Φ) 最后要求出β的值 (-βt 为e的上标,即e指数形式) 展开
所求函数形式为 Ae-βt cos(wt+Φ) 最后要求出β的值 (-βt 为e的上标,即e指数形式) 展开
2个回答
展开全部
t=[0.1,1.1,2.3,3.4,4.5,5.7,6.7]';
y=[0,94.0,84.0,77.0,69.0,62.0,56.0]';
ft_ = fittype('A*exp(-beta*t)*cos(w*t+phi)',...
'dependent',{'y'},'independent',{'t'},...
'coefficients',{'A', 'beta', 'phi', 'w'});
st=[-100 0.01 -pi 5]
[curve, goodness]= fit(t,y,ft_,'Startpoint',st)
figure
plot(curve,'predobs',0.95);
hold on,plot(t,y,'b*')
st =
-100.0000 0.0100 -3.1416 5.0000
curve =
General model:
curve(t) = A*exp(-beta*t)*cos(w*t+phi)
Coefficients (with 95% confidence bounds):
A = -143.8 (-219.6, -68.05)
beta = 0.135 (0.01584, 0.2541)
phi = -2.131 (-2.379, -1.883)
w = 5.394 (5.259, 5.529)
goodness =
sse: 352.1786
rsquare: 0.9377
dfe: 3
adjrsquare: 0.8754
rmse: 10.8348
y=[0,94.0,84.0,77.0,69.0,62.0,56.0]';
ft_ = fittype('A*exp(-beta*t)*cos(w*t+phi)',...
'dependent',{'y'},'independent',{'t'},...
'coefficients',{'A', 'beta', 'phi', 'w'});
st=[-100 0.01 -pi 5]
[curve, goodness]= fit(t,y,ft_,'Startpoint',st)
figure
plot(curve,'predobs',0.95);
hold on,plot(t,y,'b*')
st =
-100.0000 0.0100 -3.1416 5.0000
curve =
General model:
curve(t) = A*exp(-beta*t)*cos(w*t+phi)
Coefficients (with 95% confidence bounds):
A = -143.8 (-219.6, -68.05)
beta = 0.135 (0.01584, 0.2541)
phi = -2.131 (-2.379, -1.883)
w = 5.394 (5.259, 5.529)
goodness =
sse: 352.1786
rsquare: 0.9377
dfe: 3
adjrsquare: 0.8754
rmse: 10.8348
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询