From: Tobias malach on
Hi,
I'm asking for help.
There is a vector of lenght M. For example i know that there is a value 1.5 somewhere in vector(I used function "max") but I need to know the position of this vaule in vector.

Could someone help?

Thanks.
From: James Tursa on
"Tobias malach" <tmalach(a)seznam.cz> wrote in message <hv79a9$o83$1(a)fred.mathworks.com>...
>
> There is a vector of lenght M. For example i know that there is a value 1.5 somewhere in vector(I used function "max") but I need to know the position of this vaule in vector.

doc max

Look at the last syntax. e.g.,

[m x] = max(v); % m is max, x is index of max

James Tursa
From: Debanga Neog on
Hi,
A more appropriate solution can be:
Let,
A = [1 3 22 1.5 6];
For finding the index of value 1.5, use:
index = find(A == 1.5);


-DRN
From: us on
"Debanga Neog" <debanga_raj(a)yahoo.co.in> wrote in message <hv7aj0$dr7$1(a)fred.mathworks.com>...
> Hi,
> A more appropriate solution can be:
> Let,
> A = [1 3 22 1.5 6];
> For finding the index of value 1.5, use:
> index = find(A == 1.5);
>
>
> -DRN

well... maybe(!)...
just keep this in mind

http://matlabwiki.mathworks.com/MATLAB_FAQ#Why_is_0.3-0.2-0.1_not_equal_to_zero_.28or_similar.29.3F

us
From: Tobias malach on
"us " <us(a)neurol.unizh.ch> wrote in message <hv7c00$ff2$1(a)fred.mathworks.com>...
> "Debanga Neog" <debanga_raj(a)yahoo.co.in> wrote in message <hv7aj0$dr7$1(a)fred.mathworks.com>...
> > Hi,
> > A more appropriate solution can be:
> > Let,
> > A = [1 3 22 1.5 6];
> > For finding the index of value 1.5, use:
> > index = find(A == 1.5);
> >
> >
> > -DRN
>
> well... maybe(!)...
> just keep this in mind
>
> http://matlabwiki.mathworks.com/MATLAB_FAQ#Why_is_0.3-0.2-0.1_not_equal_to_zero_.28or_similar.29.3F
>
> us


everything's fine thank you very much!!!