How i use numerical integration in nonlinear curvefitting ? because integration is not working in nonlinear curve fitting.Is any one give me one example in which numerical integration correctly working with respect to time limits?

20 ビュー (過去 30 日間)
x0=[0.5,6,3,5,6,1];
lb=[];
ub=[];
x= lsqcurvefit(@myfun1,x0,xdata,ydata,lb,ub,options)
disp=linspace(xdata(1),xdata(end));
figure(7);plot(xdata,ydata,'ko',disp,myfun1(x,disp),'b-')
axis([-50 50 0 0.015]);
legend('data','fitted exponential')
title('Data and Fitted Curve')
function F = myfun1(x,xdata)
T=x(4);
F=@(T) x(1).*exp(-((x(2).*xdata-x(3).*T).^2.*xdata + x(5).^2.*xdata)/2.*x(6).*xdata);
F=integral(F,-T,T,'ArrayValued',true);
F=double(F);
  1 件のコメント
Torsten
Torsten 2019 年 4 月 15 日
You mean
function F = myfun1(x,xdata)
T1=x(4);
F=@(T) x(1).*exp(-((x(2).*xdata-x(3).*T).^2.*xdata + x(5).^2.*xdata)/2.*x(6).*xdata);
F=integral(F,-T1,T1,'ArrayValued',true);
?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by