Elemination in for loop

8 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by