This is my best interpretation of what the OP wants.
alist = RandomChoice[{"banana", "apple", "orange", "grapes"}, 9]
{"grapes", "orange", "orange", "banana", "orange", "orange", \
"grapes", "banana", "banana"}
Suppose the positions of "orange" have to be detected.
pos = Flatten@Position[alist, "orange"]
{2, 3, 5, 6}
A[[3, pos]] = 1
A // MatrixForm
$$\left(
\begin{array}{ccccccccc}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 1 & 0 & 1 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{array}
\right)$$
EDIT
Assuming that a pair of (valid) numbers is to be used to change the entry at that index to 13:
pos = {3, 8} (* received from some function *)
A[[First@pos, Last@pos]] = 13
A // MatrixForm
$$\left(
\begin{array}{ccccccccc}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 1 & 0 & 1 & 1 & 0 & 13 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{array}
\right)$$
ReplacePart[A, a -> 1]
? $\endgroup$ReplacePart[A, a -> 1]
will create a new matrix that is what you want. You can assign that toA
. $\endgroup$SparseArray[{2, 3} -> 1, {4, 9}]; % // MatrixForm
$\endgroup$A[[Sequence @@ a]] = 1
$\endgroup$