How do I delete multiple elements from a column array using a while loop?

1 vue (au cours des 30 derniers jours)
Brandon Murray
Brandon Murray le 7 Nov 2019
Commenté : Jan le 7 Nov 2019
For example if I wanted to delete every element in an array where the array is equal to 0?

Réponses (1)

Shubham Gupta
Shubham Gupta le 7 Nov 2019
Modifié(e) : Shubham Gupta le 7 Nov 2019
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by