フィルターのクリア

Using IF to remove upper and lower boundaries

2 ビュー (過去 30 日間)
Tom
Tom 2012 年 10 月 29 日
Within a FOR loop, I can successfully implement a single IF statement to prevent either the upper or lower values from being manipulated like so:
if (theta1 > 0.7297)
continue
end
However every attempt I have made to remove both upper and lower values has failed. Can anyone explain what is wrong with this:
if (theta1 > 0.7297)
else (theta1 < -0.7297)
continue
end
Thanks.

採用された回答

Arthur
Arthur 2012 年 10 月 29 日
So you want to continue if theta1 > 0.7297 or if theta < -0.7297? Then you could test for both in the if statement:
if (theta1 > 0.7297) || (theta1 < -0.7297)
continue
end
  1 件のコメント
Tom
Tom 2012 年 10 月 29 日
Thanks. That link was very helpful.

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

その他の回答 (1 件)

Thomas
Thomas 2012 年 10 月 29 日
編集済み: Thomas 2012 年 10 月 29 日
I think this is what you need
if (theta1 > 0.7297 || theta1 < -0.7297)
continue
end
You can enter both conditions in the single If statement.
  1 件のコメント
Tom
Tom 2012 年 10 月 29 日
Thankyou very much, that's exactly right!

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

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by