|
"anil chandy" <anilvchandy@gmail.com> wrote in message
news:gl1srt$aaj$1@fred.mathworks.com...
>i have two matrixes for eg
> a=[68;34;69;12;30;29;90;38;10;59;40]
> b=[12;3;4;4;12;3;6;7;7;8;12]
> here b is formed by masking the last two bits of each element in a ..
?
When written in binary, 68 is 1000100 -- "masking the last two bits of each
element of a" would give you 68 (if by 'masking' you mean 'setting to zero')
or 17 (if by 'masking' you mean 'a right-shift by two places'), not 12.
> here 68, 30, 40 in matrix a corresponds to 12 in b. 34,29 etc corresponds
> to 3....so i have to find the coorresponding elements in a for the
> repeating elements in b.. in this eg for 12,3,4,7 etc..
Use UNIQUE on B, and then use one of the outputs of UNIQUE as indices into
A. I'll let you figure out the details.
> then i have the find the average of the elements (eg average of
> 68,30,40).. can anyone pls help me out..
HELP MEAN.
--
Steve Lord
slord@mathworks.com
|