MATLAB: How to find which postions in a vector has negative values and output them

vector

i have a vector and need to find the postions which has negative values

Best Answer

Say your vector is A:
idx=find(A<0)
ANeg=A(idx)
Related Question