Find missing elements of a vector

19 vues (au cours des 30 derniers jours)
Nikolas Spiliopoulos
Nikolas Spiliopoulos le 10 Déc 2019
Hi all,
I have a vector =1:1:80;
I have a vector with these numbers=[ 1 3 5 12 34 44 55 62 63 68 69 70 72 75 79];
How can I get the missing elements of the initial vector in anothrer vector?
the other vector will be = [2 4 6 7 8 9 10 11 13 etc.]
thanks a lot
Nikolas

Réponse acceptée

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH le 10 Déc 2019
vector =1:1:80;
numbers=[ 1 3 5 12 34 44 55 62 63 68 69 70 72 75 79];
another = setdiff(vector,numbers)

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays 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