The paper is concerned with computing generalized (outer) inverses of the following form: Given a matrix $A\in\Bbb R^{m\times n}$, a subspace $\scr{T}$ of $\Bbb R^{n}$ with dimension $s\leq {\rm rank}(A)$, and a subspace $\scr{S}$ of $\Bbb R^{m}$ with dimension $m-s$, there is a unique matrix $X$ with range $\scr{R}(X)=\scr{T}$ and null space $\scr{N}(X)=\scr{S}$ such that $XAX=X$ if and only if $A\scr{T}\oplus\scr{S} =\Bbb R^{m}$. In this case, $X$ is called the $A^{(2)}_{\scr{T},\scr{S}}$ inverse of $A$. Special cases include the Moore-Penrose, Drazin and Bott-Duffin inverses. \par The authors prescribe the subspaces by means of a matrix $W\in\Bbb R^{n\times m}$ that defines $\scr{T}=\scr{R}(W)$ and $\scr{S}=\scr{N}(W)$. The $A^{(2)}_{\scr{T},\scr{S}}$ inverse is explicitly computed in terms of the thin SVD of $W$, that is, the $s$ nonzero singular values of $W$ and their corresponding left and right singular vectors. For a given $t< s$, the authors also compute the $A^{(2)}_{\scr{T}_t,\scr{S}_t}$ inverse obtained from the truncated SVD of $W$ corresponding to the $t$ largest singular values. \par Numerical examples are presented for matrices $A$ with $m,n\leq 12$.