フィルターのクリア

implementation of iterative function

35 ビュー (過去 30 日間)
shivani
shivani 2015 年 3 月 19 日
コメント済み: shivani 2015 年 3 月 19 日
How can we implement the iterative function F(x)= [((1-2*q)*(x-q))/(p-q)]+q we have to iterate it for some values of i and generate the values of xi where xi=F(xi-1). initially let.

採用された回答

Torsten
Torsten 2015 年 3 月 19 日
n=...;
p=...;
q=...;
x0=...;
f=@(x)(1-2*q)*(x-q)/(p-q)+q;
for ii=1:n
xnew=f(xold);
xold=xnew;
end
Best wishes
Torsten.
  8 件のコメント
Torsten
Torsten 2015 年 3 月 19 日
Im=imread();
[n m]=size(A);
L=m*n;
x0=0.27;
p=0.4;
q=0.1;
xold=x0;
output=zeros(L);
output(1)=xold;
f=@(x)(1-2*q)*(x-q)/(p-q)+q;
for ii=1:L-1
xnew=f(xold);
xold=xnew;
output(ii+1)=xold;
end
Note that xold becomes bigger and bigger during the Iteration such that you may get xold=Infinity if L is large enough.
Best wishes
Torsten.
shivani
shivani 2015 年 3 月 19 日
ok thanx..:)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by