Identifying the first number in a series in the same vector?

2 次查看(过去 30 天)
I need to identify the first number in a series that is within the same vector such as:
1.97756000000000
1.97784000000000
1.97856000000000
1.97884000000000
1.97912000000000
1.97920000000000
6.28712000000000
6.28968000000000
6.29108000000000
6.29148000000000
6.29180000000000
11.6901600000000
11.6903200000000
11.6904800000000
11.6906400000000
11.6910400000000
16.0839200000000
16.0843600000000
16.0850400000000
16.0852400000000
16.0856800000000
20.4872000000000
20.4883200000000
20.4885600000000
20.4887200000000
I need to list the first 1, 6, 11, 16...etc. Any help is appreciated for this basic question!

采纳的回答

Jon
Jon 2021-12-6
编辑:Jon 2021-12-6
define your vector as x then
y = unique(floor(x))
floor gets rid of the decimal part, unique gets rid of the repetitions

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by