I would like to store values in the way that every value is mapped onto either 1 or 0. For example:
3 => 0
6 => 1
9 => 1
7 => 1
For a given value I would like to be able to find all other values with the same mapped value. In this example value 6 would also yield values 9 and 7.
What is the best solution in matlab?
If the only thing you need is to have some value assigned to some other real numbers (this is at least what it looks like in your question), you should simply use arrays:
now you can extract all indices with a 1 or 0 using find