ind2sub函数使用方法
2011-11-04 11:40
826 查看
ind2sub函数可以用来把矩阵元素的index转换成对应的下标(determines the equivalent subscript values corresponding to a single index into an array)
例如: 一个4*5的矩阵A,第2行第2个元素的index的6(matlab中matrix是按列顺序排列),可以用ind2sub函数来计算这个元素的下标 [I,J] = ind2sub(size(A),6)
[I,J] = ind2sub(siz,IND) returns the matrices I and J containing the equivalent row and column subscripts corresponding to each linear index in the matrixIND for a matrix of size
siz. siz is a vector with ndim(A) elements (in this case, 2), where
siz(1) is the number of rows andsiz(2) is the number of columns.
例子:For matrices, [I,J] = ind2sub(size(A),find(A>5)) returns the same values as[I,J] = find(A>5).
例如: 一个4*5的矩阵A,第2行第2个元素的index的6(matlab中matrix是按列顺序排列),可以用ind2sub函数来计算这个元素的下标 [I,J] = ind2sub(size(A),6)
[I,J] = ind2sub(siz,IND) returns the matrices I and J containing the equivalent row and column subscripts corresponding to each linear index in the matrixIND for a matrix of size
siz. siz is a vector with ndim(A) elements (in this case, 2), where
siz(1) is the number of rows andsiz(2) is the number of columns.
例子:For matrices, [I,J] = ind2sub(size(A),find(A>5)) returns the same values as[I,J] = find(A>5).
相关文章推荐
- 什么是C++虚函数、虚函数的作用和使用方法
- ni_set()函数的使用 以及 post_max_size,upload_max_filesize的修改方法
- Python使用函数默认值实现函数静态变量的方法
- Linux时间函数之gettimeofday()函数之使用方法
- select 函数使用方法
- python文件中的__name__=='__main__'的使用及调用其他py文件中的函数方法
- Python的hasattr() getattr() setattr() 函数使用方法
- 有关文件的操作 fopen/fwriite/fseek/ftell/fread/fclose等函数的使用方法
- Android使用ksoap2调用C#中的webservice函数方法
- PHP中strtotime函数使用方法详解
- PHP中uploaded_files函数使用方法详解
- Linux时间函数之gettimeofday()函数之使用方法
- http_build_query()函数使用方法
- Ajax - 在函数中使用Ajax怎么使用返回值 - Ajax赋值给全局变量异常的解决方法
- Python使用装饰器和线程限制函数执行时间的方法
- 关于C语言中getopt()函数的使用方法
- 函数中使用require_once问题深入探讨 优雅的配置文件定义方法推荐
- C# 小数点后保留两位小数,四舍五入的函数及使用方法
- pthread_cleanup_push/pop函数使用方法
- http_build_query()函数使用方法