From: what ever on
Hello people!

I have a problem i can't fix!

Imagine that i have a array A=[1,2,3,4,5,6]

and a matrix M=[1 6 8 44 7 4]
[53 8 3 7 2 8]
[1 2 3 4 5 6]
[3 5 7 7 3 7]
[1 2 3 4 5 6]

I want a final array that give me the position where A and M are the same, in this case the final array should be:

FinalArray=[3 4]

Thanks!!!

And imagine that the last array of M was [1 2.0004 3 4 5.0003 6.0006]

what i should do so that the result also include this one?
From: Walter Roberson on
what ever wrote:

> Imagine that i have a array A=[1,2,3,4,5,6]
>
> and a matrix M=[1 6 8 44 7 4]
> [53 8 3 7 2 8]
> [1 2 3 4 5 6]
> [3 5 7 7 3 7]
> [1 2 3 4 5 6]
>
> I want a final array that give me the position where A and M are the
> same,

See the ismember 'rows' option.
From: Roger Stafford on
"what ever" <vasco_taveira(a)hotmail.com> wrote in message <huoo0v$9ib$1(a)fred.mathworks.com>...
> Hello people!
>
> I have a problem i can't fix!
>
> Imagine that i have a array A=[1,2,3,4,5,6]
>
> and a matrix M=[1 6 8 44 7 4]
> [53 8 3 7 2 8]
> [1 2 3 4 5 6]
> [3 5 7 7 3 7]
> [1 2 3 4 5 6]
>
> I want a final array that give me the position where A and M are the same, in this case the final array should be:
>
> FinalArray=[3 4]
>
> Thanks!!!
>
> And imagine that the last array of M was [1 2.0004 3 4 5.0003 6.0006]
>
> what i should do so that the result also include this one?

To allow a "tol" amount of differece between A and the row of M:

p = find(all(abs(M-repmat(A,size(M,1),1))<tol,2)); % Finalarray

Roger Stafford
From: what ever on
thanks a lot Walter and Roger!!