How can i do the sampling of a binary image?
It depends on what "sampling" exactly means. Also "binary image" is not defined, so please post the inputs, the definition of the calculations and an example for the wanted outputs.
Here's a way:
subsampledImage = binaryImage(1:2:end, 1:8:end);
How's that? It does exactly what you asked. It you want something more specific, you should explain further.