Prev: How to detect what and how many classes in dataset in statistic and/or prtools
Next: Matrix Algebra: inverse
From: Snow White on 21 Jul 2010 10:05 "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 21 Jul 2010 10:19 "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);
First
|
Prev
|
Pages: 1 2 Prev: How to detect what and how many classes in dataset in statistic and/or prtools Next: Matrix Algebra: inverse |