Elemination in for loop

8 ビュー (過去 30 日間)
Najiya Omar
Najiya Omar 2018 年 1 月 23 日
コメント済み: Star Strider 2018 年 1 月 24 日
I have Loop from 0.1:0.1:0.1 and I want to skip some cases in this loop like 0.3, 0.7 0.9

採用された回答

Star Strider
Star Strider 2018 年 1 月 23 日
Try this:
v = 0.1:0.1:1;
exclude = [0.3, 0.7, 0.9];
[L1,L2] = ismembertol(v, exclude, 0.01);
new_v = v(~L1)
  4 件のコメント
Najiya Omar
Najiya Omar 2018 年 1 月 24 日
Thank you both It works
Star Strider
Star Strider 2018 年 1 月 24 日
@Najiya Omar —
If my Answer helped you solve your problem, please Accept it!

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

その他の回答 (0 件)

カテゴリ

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