How to create a vector of all elements in another vector that meet a certain condition?

6 visualizaciones (últimos 30 días)
I have a vector, A, of 1000+ data points, and I want to create a new vector, A_pos, that contains only the positive values for that vector.
How can I do this?

Respuestas (1)

Thorsten
Thorsten el 4 de Abr. de 2017
A_pos = A(A>0);

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by