如何用max找二维数组中最大值的坐标
clcclear
a=;
=max(a(:));
已经找到最大值的是第I个数字,如何得到二维的坐标即:(3,2)
先谢谢 help ind2sub 谢谢lsd
matlab无所不能:lol
回复 沙发 rocwoods 的帖子
学习学习!由于电脑上不能装Matlab,已经有半年没有接触了!
能否介绍一下ind2sub命令?
谢谢啦
回复 地板 ch_j1985 的帖子
怕翻译不准确了影响你的理解。最笨的方法-------直接贴上来了哈。。:lol
IND2SUB Multiple subscripts from linear index.
IND2SUB is used to determine the equivalent subscript values
corresponding to a given single index into an array.
= IND2SUB(SIZ,IND) returns the arrays I and J containing the
equivalent row and column subscripts corresponding to the index
matrix IND for a matrix of size SIZ.
For matrices, = IND2SUB(SIZE(A),FIND(A>5)) returns the same
values as = FIND(A>5).
= IND2SUB(SIZ,IND) returns N subscript arrays
I1,I2,..,In containing the equivalent N-D array subscripts
equivalent to IND for an array of size SIZ.
Class support for input IND:
float: double, single
页:
[1]