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

1 visualización (últimos 30 días)
For example if I wanted to delete every element in an array where the array is equal to 0?

Respuestas (1)

Shubham Gupta
Shubham Gupta el 7 de Nov. de 2019
Editada: Shubham Gupta el 7 de Nov. de 2019
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by