Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I enhance max function scilab?

9 views
Skip to first unread message

Marco Esteves

unread,
Dec 10, 2009, 1:47:10 PM12/10/09
to
Hello, I need determine what is the maximum number of matrix and where
is located.
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?

philippe

unread,
Dec 10, 2009, 4:22:10 PM12/10/09
to
Hi marco,

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.

Marco Esteves

unread,
Dec 11, 2009, 10:03:45 AM12/11/09
to
On 10 Dez, 21:22, philippe <rou...@sfr.fr> wrote:
> Hi marco,
>
> Marco Esteves a écrit :
T
Thank you very much.
I hope this solution can solve all my problems with arguments of
array.
0 new messages