フィルターのクリア

Where is my mistake in loop?

2 ビュー (過去 30 日間)
Volkan Yangin
Volkan Yangin 2016 年 10 月 13 日
回答済み: Adam 2016 年 10 月 13 日
If the gap until more than 0.05 between first and t. value, there must be created a linear change between first and t. value. I am using while and polyfit-polyval commands but i don't understand where is my error May you help me? Note: egimm= -0,012 -0,012 -0,012 -0,012 -0,012 -0,012 -0,012 -0,024 -0,031 -0,027 -0,023 -0,019 -0,028 -0,033 -0,0332 -0,057 -0,060 -0,064 etc.
for t=1:numel(egimm)
while abs(egimm(1)-egimm(t))>0.05;
a=egimm(1:t-1);
b=1:(t-1); %line matrix
c=polyfit(b',a,1);
d=polyval(c,b');
end
end
  2 件のコメント
Adam
Adam 2016 年 10 月 13 日
You haven't posted any error. What exactly is the problem?
Volkan Yangin
Volkan Yangin 2016 年 10 月 13 日
MATLAB gives me ''busy'' error and it is not solving for minutes

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

回答 (2 件)

Guillaume
Guillaume 2016 年 10 月 13 日
Not even trying to understand what your code is doing, the problem is obvious
while some condition
do something that does not affect the condition
end %retry until condition changes
is going to run forever

Adam
Adam 2016 年 10 月 13 日
busy isn't an error, it just means it is busy working. You can use the pause functionality of the editor if you are using a recent version of Matlab to see where the code is at any given time though.
You don't appear to ever change the variable used in the while test so it will evaluate to the same thing constantly and never terminate.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by