Is every $\mathcal{O}_X$-module homomorphism $\mathcal{O}_X^{\oplus n} \to \mathcal{O}_X^{\oplus m}$ given by a matrix? For $A$ a ring, we know any linear map from $A^{\oplus n} \to A^{\oplus m}$ is given by a $m \times n$ matrix. For $(X,\mathcal{O}_X)$ a locally ringed space (or scheme), is every $\mathcal{O}_X$-module homomorphism $\mathcal{O}_X^{\oplus n} \to \mathcal{O}_X^{\oplus m}$ given by a matrix with coefficients in $\Gamma(X,\mathcal{O}_X)$?
 A: Yes, and the reason is basically the same as for rings: on any ringed space $(X, \mathscr{O}_X)$, the $\mathscr{O}_X$-module $\mathscr{O}_X$ represents the global sections functor on the category of $\mathscr{O}_X$-modules. In other words, there's a natural isomorphism $\mathrm{Hom}(\mathscr{O}_X, \mathscr{F}) \to \Gamma(X, \mathscr{F})$ of abelian groups, given by mapping $\phi \in \mathrm{Hom}(\mathscr{O}_X, \mathscr{F})$ to the image of 1 under $\phi$ on the map $\Gamma(X, \mathscr{O}_X) \to \Gamma(X, \mathscr{F})$ induced by $\phi$ on global sections. I think proving this fact is not too difficult an exercise, but I can provide more details if you let me know.
Having proved this, we have isomorphisms
$\mathrm{Hom}(\mathscr{O}_X^{\oplus n}, \mathscr{F}) \to \mathrm{Hom}(\mathscr{O}_X, \mathscr{F})^{\oplus n} \to \Gamma(X, \mathscr{F})^{\oplus n}$.
The first isomorphism is a consequence of the universal property of direct sums. The second one is obtained by taking a direct sum of isomorphism that we established earlier. If you chase through it, this composite isomorphism is given by mapping $\phi \in \mathrm{Hom}(\mathscr{O}_X^{\oplus n}, \mathscr{F})$ to $(\phi(e_1), \dotsc, \phi(e_n))$, where $e_i$ is the standard basis vector of $\Gamma(X, \mathscr{O}_X^{\oplus n}) = \Gamma(X, \mathscr{O}_X)^{\oplus n}$ and $\phi(e_i)$ is its image under the map induced by $\phi$ on global sections.
Now taking $\mathscr{F} = \mathscr{O}_X^{\oplus m}$ gives you what you want.  
A: I'll answer the $m  =n =1$ case and the rest follows because finite direct sums are the same as the corresponding finite direct sum of presheaves of $\mathcal{O}_X$-modules (Lemma 3.2 of modules, Stacks Project). Now for any $U \subseteq X$, consider the diagram
$$\begin{array}{ccc} \mathcal{O}_X(X) & \stackrel{f(X)}{\longrightarrow} & \mathcal{O}_X(X) \\
\downarrow && \downarrow \\
\mathcal{O}_X(U) &\stackrel{f(U)}{\longrightarrow}& \mathcal{O}_X(U)\end{array}$$
Now I claim everything is completely determined by the image of $1 \in \mathcal{O}_X(X)$ under $f(X)$. Indeed, the point is that the restriction $\mathcal{O}_X(X) \to \mathcal{O}_X(U)$ is a ring homomorphism and so $1$ is sent to $1$. Now $f(U)$ being an $\mathcal{O}_X(U)$-module homomorphism implies it is completely determined by the image of $1$. It follows by commutivity of the diagram that $$f(U)(1) = f(X)(1)|_U$$
and so 
$$\operatorname{Hom}_{\mathcal{O}_X}(\mathcal{O}_X,\mathcal{O}_X) = \Gamma(X,\mathcal{O}_X)$$
as desired.
