Matlab: 新学到的函数
2016-07-13 15:08
155 查看
unique
ismember
find
intersect
>> A = [9 2 9 5]; >> [C, ia, ic] = unique(A) %Find the unique values of A and the index vectors ia and ic, such that C = A(ia) and A = C(ic). C = 2 5 9 ia = 2 4 1 ic = 3 1 3 2
ismember
>> A = [5 3 4 2];B = [2 4 4 4 6 8]; >> Lia = ismember(A,B) %Determine which elements of A are also in B. Lia = 0 0 1 1
find
>> X = [3 2 0; -5 0 7; 0 0 1] X = 3 2 0 -5 0 7 0 0 1 >> [row,col,v] = find(X) %Find the nonzero elements in a 3-by-3 matrix. Specify three outputs to return the row subscripts, column subscripts, and element values. row = 1 2 1 2 3 col = 1 1 2 3 3 v = 3 -5 2 7 1
intersect
>> A = [7 1 7 7 4]; B = [7 0 4 4 0 5]; >> C = intersect(A,B) %Find the values common to both A and B. C = 4 7
相关文章推荐
- harris角点检测计算详细步骤
- matlab 三个向量数据绘制曲面图
- 图解在Matlab中初步操作一下3D图形学算法
- 决策树--matlab自带函数
- Matlab:基本数据类型[转载]
- Matlab实现决策树算法进行数字识别
- Matlab + VS | Matlab2014a + VS2010 Win7 混编调试
- DAV 入门之 MATLAB (6):Simulink
- DAV 入门之 MATLAB (5):保存代码
- DAV 入门之 MATLAB (4):明确设计
- MATLAB三维图形的投影
- DAV 入门之 MATLAB (2):命令行窗口,最方便的平台
- 混沌时间序列的几个例子
- MATLAB的solve函数
- DAV 入门之 MATLAB (1):不一样的入门
- 对cell赋值 matlab
- 样本不同特征构成的协方差矩阵
- matlab 文件目录及路径操作
- matlab读入视频序列并播放 代码
- 基础算法(二):Kmeans聚类算法的基本原理与应用