How to keep only positive values in an array?

473 ビュー (過去 30 日間)
Priyanka Roy
Priyanka Roy 2015 年 9 月 1 日
コメント済み: per isakson 2015 年 9 月 1 日
I have a sorted array with different values: -18 -13 0 8 51 133 255
I only keep the positive values : 0 8 51 133 255
How do i do this?
  1 件のコメント
per isakson
per isakson 2015 年 9 月 1 日
How do the tags relate to the question?

サインインしてコメントする。

採用された回答

per isakson
per isakson 2015 年 9 月 1 日
編集済み: per isakson 2015 年 9 月 1 日
Given 1D-array, i.e a vector
>> A = [ -18 -13 0 8 51 133 255]
A =
-18 -13 0 8 51 133 255
>> B = A( A>=0 )
B =
0 8 51 133 255
>>

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by