Clear Filters
Clear Filters

如何得到一个由数字构成的向量中有几组数字?

2 views (last 30 days)
DY
DY on 25 Dec 2023
Answered: kei hin on 25 Dec 2023
例:
T的数值中包含14,9,16这3个种类的值,
T = [14 14 9 16 9 9 16 14];
如何对T进行函数处理,得到3这个答案?

Accepted Answer

kei hin
kei hin on 25 Dec 2023
num = length(unique(T));

More Answers (0)

Categories

Find more on in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!