The ind2sub command determines the equivalentsubscript values corresponding to a single index into an array.
ind2sub 将数组中的索引转换成矩阵中的坐标。
[I,J] = ind2sub(siz,IND) 返回矩阵I(行下标),J (列下标)。siz是一个向量,siz(1)表示行数,siz(2)表示列数。IND 是索引。
>> a=[1 2 4;5 8 7;9 0 4];
>> ind=[2 5 7];
>> [i,j]=ind2sub(size(a),ind)
i =
2 2 1
j =
1 2 3
最后
以上就是紧张糖豆最近收集整理的关于ind2sub用法的全部内容,更多相关ind2sub用法内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复