Oops never mind, I had a typo in my model with the parentheses. Negative sign was supposed to be outside the ()^2, otherwise the values become infinite real fast.
Inf Computed by model function
1 次查看(过去 30 天)
显示 更早的评论
I'm trying to fit some data to the following model using fit and fittype:
model1=fittype('h*exp((-w*x)^2)*(sin(w*x))','independent,{'x'},'coefficients',{'h','w'});
When I try to do the fit I get the error message: Inf computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients.
I tried tightening them pretty tightly but I still get this error.
The data I'm trying to fit is this:
x: [-169.3662 -149.8015 -130.3560 -110.7559 -90.4435 -70.1957 -50.5075 -35.9124 -15.4939 10.7868 30.6151 50.4345 69.3836 89.8258 109.6690 130.0456 149.6947 169.9521]
y: [0.4029 -0.6778 -0.3065 -0.8638 -2.7271 -3.0545 -6.0058 -4.7192 0.2971 1.2499 2.0040 3.9745 3.0164 1.4674 2.5399 0.9531 0.3945 -0.1607]
Is there some option i can use to get this to work? Thanks!
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!