Elemination in for loop

3 vues (au cours des 30 derniers jours)
Najiya Omar
Najiya Omar le 23 Jan 2018
Commenté : Star Strider le 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

Réponse acceptée

Star Strider
Star Strider le 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 commentaires
Najiya Omar
Najiya Omar le 24 Jan 2018
Thank you both It works
Star Strider
Star Strider le 24 Jan 2018
@Najiya Omar —
If my Answer helped you solve your problem, please Accept it!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by