"matthew mccarthy" <batter8@aol.com> wrote in message <gq6n61$di7$1@fred.mathworks.com>...
> I am having trouble finding values in two matrices. I have two matrices that are both 215x215 and I need to find two values in one matrix that are also in the other. The problem I am having is I can only find one value. I am trying to use the [r,c]=find(m=v).
> Thanks for the help
What precisely do you mean by "find two values in one matrix that are also in the other"? I would interpret this language as meaning that the locations of common elements in the two matrices do not have to be the same. In that case, the use of 'find' is inappropriate. It only finds elements that match both in value and in location.
Instead you should use 'intersect'.
c = intersect(a,b);
where a and b are the two matrices. The vector c will contain all elements common to both a and, regardless of location. If c contains more than two elements, the first two (or any two) would satisfy your requirements.
Roger Stafford
