Elemination in for loop
7 views (last 30 days)
Show older comments
Najiya Omar
on 23 Jan 2018
Commented: Star Strider
on 24 Jan 2018
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
0 Comments
Accepted Answer
Star Strider
on 23 Jan 2018
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 Comments
Star Strider
on 24 Jan 2018
@Najiya Omar —
If my Answer helped you solve your problem, please Accept it!
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!