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

3 ビュー (過去 30 日間)
Nathaniel Ibarluzea
Nathaniel Ibarluzea 2017 年 4 月 4 日
回答済み: Thorsten 2017 年 4 月 4 日
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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by