Extracting number in array at certain threshold and determine its position

2 ビュー (過去 30 日間)
Suppose that i have an array, i want to extract the number that higher than 5 and i want to know their position too. how can i do it? Thanks in advance!!
X=[10 8 6 7 8 4 12]

採用された回答

David Fletcher
David Fletcher 2021 年 5 月 7 日
X=[10 8 6 7 8 4 12]
index=find(X>5)
values=X(index)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by