How can I create this simple matrix?

DNdog =
108
108
107
107
23
23
y = 108 %How do I get the above matrix to this state?
107
23

 采纳的回答

Using
unique

4 个评论

y = 23 %This is happening.
107
108
y = 108 %I want it to be like this.
107
23
Use 'stable' as the set order specifier:
y = unique(DNdog, 'stable')

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by