フィルターのクリア

How to carry out lease square fitting?

1 回表示 (過去 30 日間)
Vani Krishnan
Vani Krishnan 2014 年 5 月 8 日
回答済み: Star Strider 2014 年 5 月 8 日
Hi, I am attempting to fit data that should fit the following function:
F =1i*x(1)+1i*(x(2)-x(1))./(1+(1i*2*pi*freq*x(3))).^(1-x(4))-1i*xdata
x(1:4) are the constants that needs to be optimizeed and omega (2*pi*freq) is the variable for the function. I have xdata and ydata for each freq value.
Following is the code I written but it gives Solver stopped prematurely.
freq = 100:100:1000; Rdata=[500 800 1000 2000 3500 5000 7500 10000 11000 12000]; Idata = [300 600 900 1500 2000 1800 1200 800 500 200]; plot(Rdata,Idata,'ro') F = @(x,xdata)1i*x(1)+1i*(x(2)-x(1))./(1+(1i*2*pi*freq*x(3))).^(1-x(4))-1i*xdata; x0 = [1 1 1 0]; [x,resnorm,~,exitflag,output] = lsqcurvefit(F,x0,Rdata,Idata); plot(Rdata,F(x,Rdata))
Could you please help me in solving this problem.

採用された回答

Star Strider
Star Strider 2014 年 5 月 8 日
If the solver stopped prematurely, it means that it reached the limit of function evaluations or iterations before it minimised the function. Use the optimoptions function to increase the number of function evaluations, iterations, or whatever lsqcurvefit asks you to increase. This is not an error but a suggestion.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by