[nmax,arg]=max(x)
x is an matrix, it returns what I want. But If is there more than
max? How can I know all vector addresses?
Marco Esteves a �crit :
> If I use something like this,
>
> [nmax,arg]=max(x)
>
> x is an matrix, it returns what I want. But If is there more than
> max? How can I know all vector addresses?
use find function, for example :
-->x=[1 5 5 2 3 4]
x =
1. 5. 5. 2. 3. 4.
-->find(x==max(x))
ans =
2. 3.
and for a 2 dimensionnal matrix
-->M=eye(3,3)
M =
1. 0. 0.
0. 1. 0.
0. 0. 1.
-->[i,j]=find(M==max(M))
j =
1. 2. 3.
i =
1. 2. 3.
see also vectorfind function.
Philippe.