Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
For example if I wanted to delete every element in an array where the array is equal to 0?

Risposte (1)

Shubham Gupta
Shubham Gupta il 7 Nov 2019
Modificato: Shubham Gupta il 7 Nov 2019
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by