matlab中的unique
来源:互联网 发布:程序员写博客的好处 编辑:程序博客网 时间:2024/05/20 00:50
向量中的那些唯一的元素
语法
b = unique(A)
b = unique(A,'rows')
[b,m,n] = unique(...)
描述
1、b = unique(A) 返回的是和A中一样的值,但是没有重复元素。产生的结果向量按升序排序。A可以是一个字符串的单元阵列。
2、b = unique(A,'rows') 返回的是A中的唯一的行数。
3、[b,m,n] = unique(...) 也返回索引向量m和n,使得B = A(M)和A=B(N)。m的每一个元素是最大的下标,使得B = A(M)。对于行的组合,B = A(M,:)和A=B(N,:)。
示例
A = [1 1 5 6 2 3 3 9 8 6 2 4]
A =
1 1 5 6 2 3 3 9 8 6 2 4
[b,m,n] = unique(A)
b =
1 2 3 4 5 6 8 9
m =
2 11 7 12 3 10 9 8
n =
1 1 5 6 2 3 3 8 7 6 2 4
A(m)
ans =
1 2 3 4 5 6 8 9
b(n)
ans =
1 1 5 6 2 3 3 9 8 6 2 4
因为NaN是互不相等的,把他们作为独特的元素对待
unique([1 1 NaN NaN])
ans =
1 NaN NaN
- matlab中的unique
- matlab中的unique函数
- matlab中的unique函数详解
- matlab unique函数
- matlab——unique
- matlab之unique函数
- matlab unique函数
- matlab unique函数
- matlab unique函数
- matlab unique函数
- Matlab中的,accumarray(),sort(),unique(),快速去掉向量中指定元素
- stl中的unique
- STL中的unique
- mysql 中的 unique key
- C++中的unique函数
- unique-----返回唯一值并排序------------matlab
- matlab unique找出矩阵中不同元素
- Matlab的unique函数的C++实现
- 实作一个简单自定义的View(一) -- A Simple Custom View Example (1)
- 流程优化辨析
- IPython notebook搭建
- 获取DNS污染被墙域名的IP地址
- 调试pcb板子的步骤
- matlab中的unique
- ISO/OSI的参考模型
- 静态内部类与非静态内部类。
- 定义DataGridView某列的类型
- C#switch语句
- 关于appearance的圆角
- Hibernate框架学习(二)
- LeetCode之Remove Duplicates from Sorted Array
- RFC6455-The WebSocket protocol 之三:WebSocket URIs