概述
ind2sub
[row,col] = ind2sub(sz,ind)
[I1,I2,…,In] = ind2sub(sz,ind)
[row,col] = ind2sub(sz,ind) returns the arrays row and col containing the equivalent row and column subscripts corresponding to the linear indices ind for a matrix of size sz. Here sz is a vector with two elements, where sz(1) specifies the number of rows and sz(2) specifies the number of columns.
[I1,I2,…,In] = ind2sub(sz,ind) returns n arrays I1,I2,…,In containing the equivalent multidimensional subscripts corresponding to the linear indices ind for a multidimensional array of size sz. Here sz is a vector with n elements that specifies the size of each array dimension.
将线性索引转换为三维数组的下标
ind = [3 4 5 6];
sz = [2 2 2];
[I1,I2,I3] = ind2sub(sz,ind)
最后
以上就是眯眯眼豆芽为你收集整理的matlab ind2sub的全部内容,希望文章能够帮你解决matlab ind2sub所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复