Extracting number in array at certain threshold and determine its position

3 次查看(过去 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 CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by