2 added 71 characters in body
source | link

MapAt Also: MapAt

list = {{1, 1}, {1, 2}, {2, 1}, {3, 3}};
q = ConstantArray[0, {3, 3}];

MapAt[1 &, q, list]

{{1, 1, 0}, {1, 0, 0}, {0, 0, 1}}

Note: this is much slower than both SparseArray and ReplacePart.

MapAt

list = {{1, 1}, {1, 2}, {2, 1}, {3, 3}};
q = ConstantArray[0, {3, 3}];

MapAt[1 &, q, list]

{{1, 1, 0}, {1, 0, 0}, {0, 0, 1}}

Also: MapAt

list = {{1, 1}, {1, 2}, {2, 1}, {3, 3}};
q = ConstantArray[0, {3, 3}];

MapAt[1 &, q, list]

{{1, 1, 0}, {1, 0, 0}, {0, 0, 1}}

Note: this is much slower than both SparseArray and ReplacePart.

1
source | link

MapAt

list = {{1, 1}, {1, 2}, {2, 1}, {3, 3}};
q = ConstantArray[0, {3, 3}];

MapAt[1 &, q, list]

{{1, 1, 0}, {1, 0, 0}, {0, 0, 1}}