making loop for parameter calculations

1 回表示 (過去 30 日間)
Matlabbey
Matlabbey 2012 年 10 月 15 日
hi all,
i would like to make a loop. i would like to continue running a code with different parameter. if lets say there is original data X and i want to manipulate this data using a method that relies on a parameter alpha to create new data series X';
1. i have X
2. run method using alpha
3. obtain X'
i want to keep X' and do some calculation with it. if it meets a specific standard i keep it, if not i start at 1 but run with new alpha. does this make sense?
thank you very much
  1 件のコメント
Matt J
Matt J 2012 年 10 月 15 日
OK. But what's the confusing part? Just use a for-loop over the alphas.

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

回答 (1 件)

NaN1988
NaN1988 2012 年 10 月 15 日
編集済み: NaN1988 2012 年 10 月 15 日
That looks like the typical while loop
alpha=[alpha1 alpha2 ...alphan]
a=0;
k=1;
while a==0
A=alpha(k)
X=f(A)
if X==specific standard
a=1
end
k=k+1;
end

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by