From: Snow White on
"us " <us(a)neurol.unizh.ch> wrote in message <i26ubi$1m0$1(a)fred.mathworks.com>...
> "Snow White" <gulesaman(a)gmail.com> wrote in message <i26rbs$hbf$1(a)fred.mathworks.com>...
> > Hello,
> >
> >
> > I have two matrices I and R, i want to find values that are equal to a certain value in I and then find the values at the extracted locations in R as well.
> >
> > I am using the following code:
> >
> > [r,c]=find(I==cut_off_val);
> >
> > to extract values from I (3xn) but find does not traverse row wise it traverses column wise apart from that how do i extract the values from R (3xn (which are a byproduct of I so i can not use intersect))
> >
> > bye
>
> show CSSM a SMALL yet exemplary data set of your input/desired output...
>
> us

I=[1 6 3;4 5 6; 6 8 9]; R=[10 20 30;14 15 16;71 81 91];
[r,c]=find(I==6);
output should be [20 16 71]
From: Andy on
"Snow White" <gulesaman(a)gmail.com> wrote in message <i26uqk$28h$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <i26ubi$1m0$1(a)fred.mathworks.com>...
> > "Snow White" <gulesaman(a)gmail.com> wrote in message <i26rbs$hbf$1(a)fred.mathworks.com>...
> > > Hello,
> > >
> > >
> > > I have two matrices I and R, i want to find values that are equal to a certain value in I and then find the values at the extracted locations in R as well.
> > >
> > > I am using the following code:
> > >
> > > [r,c]=find(I==cut_off_val);
> > >
> > > to extract values from I (3xn) but find does not traverse row wise it traverses column wise apart from that how do i extract the values from R (3xn (which are a byproduct of I so i can not use intersect))
> > >
> > > bye
> >
> > show CSSM a SMALL yet exemplary data set of your input/desired output...
> >
> > us
>
> I=[1 6 3;4 5 6; 6 8 9]; R=[10 20 30;14 15 16;71 81 91];
> [r,c]=find(I==6);
> output should be [20 16 71]

I=[1 6 3;4 5 6; 6 8 9]; R=[10 20 30;14 15 16;71 81 91];
val = 6;
output = R(I==val);