MYUNIQUE

版本 1.0.0.0 (1.4 KB) 作者: Mehmet OZTURK
finds uniqe entries, indices and number of occurances of the unique elements
2.4K 次下载
更新时间 2007/6/20

查看许可证

MYUNIQUE is a function to find unique elements in a numeric vector in the order in which they appear first or last which is determined by "mode" (default is first). The function is also outputs the indices "ndx" of unique elements and number of occurances of that elements in "h".

% Example:
% >> a=[9 3 6 2 7 1 2 1 1 1 9 9 3 3];
% >> [b ndx h]=myunique(a)
% b =
%
% 9 3 6 2 7 1
% ndx =
%
% 1 2 3 4 5 6
% h =
%
% 3 3 1 2 1 4
%
% >> myunique(a,'last')
% ans =
%
% 6 7 2 1 9 3

引用格式

Mehmet OZTURK (2024). MYUNIQUE (https://www.mathworks.com/matlabcentral/fileexchange/15242-myunique), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Added property to find number of occurances.