MATL, 10 bytes
YsG~YsQ1Z?
Inputs an array of binary digits. Outputs a matrix.
Explanation
Ys % Implicit input: array of binary digits. Cumulative sum. This gives the
% row coordinates
G % Push input again
~ % Negate: change 0 to 1 and 1 to 0
Ys % Cumulative sum
Q % Add 1. This gives the column coordinates
1Z? % Matrix containing 1 at those row and column coordinates and 0 otherwise.
% Implicit display
MATL, 10 bytes
YsG~YsQ1Z?
Inputs an array of binary digits. Outputs a matrix.
Explanation
Ys % Implicit input: array of binary digits. Cumulative sum
G % Push input again
~ % Negate: change 0 to 1 and 1 to 0
Ys % Cumulative sum
Q % Add 1
1Z? % Matrix containing 1 at those row and column coordinates and 0 otherwise.
% Implicit display
MATL, 10 bytes
YsG~YsQ1Z?
Inputs an array of binary digits. Outputs a matrix.
Explanation
Ys % Implicit input: array of binary digits. Cumulative sum. This gives the
% row coordinates
G % Push input again
~ % Negate: change 0 to 1 and 1 to 0
Ys % Cumulative sum
Q % Add 1. This gives the column coordinates
1Z? % Matrix containing 1 at those row and column coordinates and 0 otherwise.
% Implicit display
MATL, 10 bytes
YsG~YsQ1Z?
Inputs an array of binary digits. Outputs a matrix.
Explanation
Ys % Implicit input: array of binary digits. Cumulative sum
G % Push input again
~ % Negate: change 0 to 1 and 1 to 0
Ys % Cumulative sum
Q % Add 1
1Z? % Matrix containing 1 at those row and column coordinates and 0 otherwise.
% Implicit display