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 09:06 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
From: Andy on 21 Jul 2010 09:14 "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 I'm having trouble following your question. Could you provide a small sample I, R, and cut_off_val, and show us what the desired output would look like?
From: dpb on 21 Jul 2010 09:23 Snow White wrote: > 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)) v = R(sub2ind(size(I),r,c)); --
From: dpb on 21 Jul 2010 09:29 dpb wrote: > Snow White wrote: >> 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)) > > v = R(sub2ind(size(I),r,c)); .... I'll add the caveat about searching for exact matches on floating point values just in case... --
From: us on 21 Jul 2010 09:57 "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
|
Next
|
Last
Pages: 1 2 Prev: How to detect what and how many classes in dataset in statistic and/or prtools Next: Matrix Algebra: inverse |