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

조회 수: 1 (최근 30일)
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?

답변 (1개)

Thorsten
Thorsten 2017년 4월 4일
A_pos = A(A>0);

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by