フィルターのクリア

how to estimate initial conditions for lsqcurvefit function in matlab? thank u in advance.

1 回表示 (過去 30 日間)
Hemavathi
Hemavathi 2014 年 4 月 8 日
編集済み: Star Strider 2014 年 4 月 9 日
[x,resnorm]=lsqcurvefit(@myfun,x0,xdata,ydata);
how to set x0?? xdata(voltage) and ydata(displacement), experimental data are attached.
%%function: myfun function f=myfun(x,xdata) a=x(4)*xdata+x(5); for k=1:1:1; r(k)=x(1)*k; wo(k)=0; %%weighting function for i=1:1:length(a); a_b(k,i)=a(i)-r(k); ab(k,i)=a(i)+r(k); w(k,i)=max (a_b(k,i),min(ab(k,i),wo(k))); wo(k)=w(k,i); end pi(k)=x(2)*exp(-x(3)*r(k)); pfi(k,:)=pi(k)*w(k,:); end itpfi=sum(x(1)*pfi); f=a+itpfi;

回答 (1 件)

Star Strider
Star Strider 2014 年 4 月 8 日
Your problem is likely not your initial parameter estimates. Consider that the loop starting with:
for k=1:1:1;
will only execute once. (It will execute for k = 1 and stop.)
There may be other problems. Please format your code.
  2 件のコメント
Hemavathi
Hemavathi 2014 年 4 月 9 日
Hi.. thank u very much for you reply. that was by mistake. else my code has " " " "k=1:1:8; " ( 8 play operators) . i am giving 0- 135V, 1 HZ Triangular input to my piezoactuator, and getting 15 micrometer displacement with 4 micrometer nonlinearity. but with the model iam not getting hysteresis curve between xdata and modelled displacement. i am getting almost linear curve. i tried all possible methods , but still not able to get hysteresis plot. plz help.. thank you..
Star Strider
Star Strider 2014 年 4 月 9 日
編集済み: Star Strider 2014 年 4 月 9 日
I’m having problems interpreting your code. What is the original equation you want to fit?

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

カテゴリ

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