How to delete multiple of the Value in Array

6 vues (au cours des 30 derniers jours)
Med Future
Med Future le 20 Déc 2022
Commenté : Rik le 29 Déc 2022
Hello, I have the following array I want to delete the values, which are multiple of any values
How can i do that in MATLAB
  1 commentaire
Rik
Rik le 29 Déc 2022
Why did you post a duplicate question instead of responding that this isn't what you wanted?

Connectez-vous pour commenter.

Réponse acceptée

C B
C B le 20 Déc 2022
A = [1 2 3 4 5 6 7 8 9 10] % Initial array
A = 1×10
1 2 3 4 5 6 7 8 9 10
A(mod(A,3) == 0) = [] % Delete elements that are multiples of 3
A = 1×7
1 2 4 5 7 8 10

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by