Suppose I have a $2\times 4$ matrix like the following:
sampledata = {{1, , 1, 0}, {0, 1, , 1}};
It's a binary zero or one entry matrix. And as you can see, the cell {1, 2}
and {2, 3}
are empty.
What I want to do is to fill up the missing entries with all possible combinations of zeroes and ones.
So, the final matrix should look like
updateddata = {{1, 1, 1, 0},{1, 0, 1, 0}, {0, 1, 1, 1}, {0, 1, 0, 1}};
How should I proceed to get the augmented matrix of the final form?
Thank you for your comments. But I found the functions suggested works only when there are at most one missing entries in each row..
I should update my example. The matrix is
sampledata1 = {{1,,,0},{0,,1,1}}
That has two missing entries in the first row and one missing entry in the second row. So there are $2^3$ possibilities to fill in the missing entries that makes the final matrix look like
updateddata1 = {{1,1,1,0},{0,1,1,1},{1,1,1,0},{0,0,1,1},{1,1,0,0},{0,1,1,1},{1,1,0,0},{0,0,1,1},{1,0,1,0},{0,1,1,1},{1,0,1,0},{0,0,1,1},{1,0,0,0},{0,1,1,1},{1,0,0,0},{0,0,1,1}}
updateddata1
be{{1, 1, 1, 0}, {1, 1, 0, 0}, {1, 0, 1, 0}, {1, 0, 0, 0}, {0, 1, 1, 1}, {0, 1, 0, 1}}
? $\endgroup$